This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed
Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 108108 "hapi-set-header" : " ^1.0.2" ,
109109 "hoek" : " ^5.0.2" ,
110110 "ipfs-api" : " ^17.2.4" ,
111- "ipfs-bitswap" : " ~0.17.4 " ,
111+ "ipfs-bitswap" : " ~0.18.0 " ,
112112 "ipfs-block" : " ~0.6.1" ,
113113 "ipfs-block-service" : " ~0.13.0" ,
114114 "ipfs-multipart" : " ~0.1.0" ,
Original file line number Diff line number Diff line change @@ -21,11 +21,10 @@ module.exports = function bitswap (self) {
2121 throw new Error ( OFFLINE_ERROR )
2222 }
2323
24- const stats = self . _bitswap . stat ( )
25- stats . wantlist = formatWantlist ( stats . wantlist )
26- stats . peers = stats . peers . map ( ( id ) => id . toB58String ( ) )
27-
28- return stats
24+ return Object . assign ( { } , self . _bitswap . stat ( ) . snapshot , {
25+ wantlist : formatWantlist ( self . _bitswap . getWantlist ( ) ) ,
26+ peers : self . _bitswap . peers ( ) . map ( ( id ) => id . toB58String ( ) )
27+ } )
2928 } ,
3029 unwant : ( key ) => {
3130 if ( ! self . isOnline ( ) ) {
Original file line number Diff line number Diff line change @@ -261,8 +261,14 @@ describe('bitswap', function () {
261261
262262 expect ( stats ) . to . have . keys ( [
263263 'blocksReceived' ,
264+ 'blocksSent' ,
265+ 'dataReceived' ,
266+ 'dataSent' ,
267+ 'wantListLength' ,
264268 'wantlist' ,
269+ 'peerCount' ,
265270 'peers' ,
271+ 'providesBufferLength' ,
266272 'dupDataReceived' ,
267273 'dupBlksReceived'
268274 ] )
You can’t perform that action at this time.
0 commit comments