@@ -27,14 +27,9 @@ module.exports = class Monitor extends EventEmitter {
2727
2828 this . uploadStats = { ...stats }
2929 this . downloadStats = { ...stats }
30- this . uploadStats . targetBytes = this . downloadStats . targetBytes =
31- this . id . byteLength
32- this . uploadStats . targetBlocks = this . downloadStats . targetBlocks =
33- this . id . blockLength
34- this . uploadStats . peers =
35- this . downloadStats . peers =
36- this . peers =
37- this . blobs . core . peers . length
30+ this . uploadStats . targetBytes = this . downloadStats . targetBytes = this . id . byteLength
31+ this . uploadStats . targetBlocks = this . downloadStats . targetBlocks = this . id . blockLength
32+ this . uploadStats . peers = this . downloadStats . peers = this . peers = this . blobs . core . peers . length
3833
3934 this . uploadSpeedometer = speedometer ( )
4035 this . downloadSpeedometer = speedometer ( )
@@ -52,30 +47,15 @@ module.exports = class Monitor extends EventEmitter {
5247 }
5348
5449 _onUpload ( index , bytes , from ) {
55- this . _updateStats (
56- this . uploadSpeedometer ,
57- this . uploadStats ,
58- index ,
59- bytes ,
60- from
61- )
50+ this . _updateStats ( this . uploadSpeedometer , this . uploadStats , index , bytes , from )
6251 }
6352
6453 _onDownload ( index , bytes , from ) {
65- this . _updateStats (
66- this . downloadSpeedometer ,
67- this . downloadStats ,
68- index ,
69- bytes ,
70- from
71- )
54+ this . _updateStats ( this . downloadSpeedometer , this . downloadStats , index , bytes , from )
7255 }
7356
7457 _updatePeers ( ) {
75- this . uploadStats . peers =
76- this . downloadStats . peers =
77- this . peers =
78- this . blobs . core . peers . length
58+ this . uploadStats . peers = this . downloadStats . peers = this . peers = this . blobs . core . peers . length
7959 this . emit ( 'update' )
8060 }
8161
0 commit comments