File tree 1 file changed +7
-5
lines changed 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import (
11
11
bitswap "gx/ipfs/QmXRphxBT4BH2GqGHUSbqULm7wNsxnpA2NrbNaY3DU1Y5K/go-bitswap"
12
12
decision "gx/ipfs/QmXRphxBT4BH2GqGHUSbqULm7wNsxnpA2NrbNaY3DU1Y5K/go-bitswap/decision"
13
13
cmds "gx/ipfs/Qma6uuSyjkecGhMFFLfzyJDPyoDtNJSHJNweDccZhaWkgU/go-ipfs-cmds"
14
+ cidutil "gx/ipfs/QmbfKu17LbMWyGUxHEUns9Wf5Dkm8PT6be4uPhTkk4YvaV/go-cidutil"
14
15
peer "gx/ipfs/QmcqU6QUDSXprb1518vYDGczrTJTyGwLG9eUa5iNX4xUtS/go-libp2p-peer"
15
16
cmdkit "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit"
16
17
)
@@ -64,18 +65,19 @@ Print out all blocks currently on the bitswap wantlist for the local peer.`,
64
65
if err != nil {
65
66
return err
66
67
}
67
- if pid = = nd .Identity {
68
- return cmds .EmitOnce (res , & KeyList {bs .GetWantlist ( )})
68
+ if pid ! = nd .Identity {
69
+ return cmds .EmitOnce (res , & KeyList {bs .WantlistForPeer ( pid )})
69
70
}
70
-
71
- return cmds .EmitOnce (res , & KeyList {bs .WantlistForPeer (pid )})
72
71
}
72
+
73
73
return cmds .EmitOnce (res , & KeyList {bs .GetWantlist ()})
74
74
},
75
75
Encoders : cmds.EncoderMap {
76
76
cmds .Text : cmds .MakeTypedEncoder (func (req * cmds.Request , w io.Writer , out * KeyList ) error {
77
+ // sort the keys first
78
+ cidutil .Sort (out .Keys )
77
79
for _ , key := range out .Keys {
78
- fmt .Fprintln (w , key . String () )
80
+ fmt .Fprintln (w , key )
79
81
}
80
82
81
83
return nil
You can’t perform that action at this time.
0 commit comments