mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-01 14:28:02 +08:00
dont put wantlist getter in exchange interface
This commit is contained in:
parent
98a183d53e
commit
3c8a391fe4
@ -33,8 +33,13 @@ Print out all blocks currently on the bitswap wantlist for the local peer`,
|
||||
res.SetError(err, cmds.ErrNormal)
|
||||
return
|
||||
}
|
||||
bs, ok := nd.Exchange.(*bitswap.Bitswap)
|
||||
if !ok {
|
||||
res.SetError(u.ErrCast(), cmds.ErrNormal)
|
||||
return
|
||||
}
|
||||
|
||||
res.SetOutput(&KeyList{nd.Exchange.GetWantlist()})
|
||||
res.SetOutput(&KeyList{bs.GetWantlist()})
|
||||
},
|
||||
Marshalers: cmds.MarshalerMap{
|
||||
cmds.Text: KeyListTextMarshaler,
|
||||
|
||||
@ -21,7 +21,5 @@ type Interface interface {
|
||||
// available on the network?
|
||||
HasBlock(context.Context, *blocks.Block) error
|
||||
|
||||
GetWantlist() []u.Key
|
||||
|
||||
io.Closer
|
||||
}
|
||||
|
||||
@ -66,8 +66,3 @@ func (e *offlineExchange) GetBlocks(ctx context.Context, ks []u.Key) (<-chan *bl
|
||||
}()
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// implement Exchange
|
||||
func (e *offlineExchange) GetWantlist() []u.Key {
|
||||
return nil
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user