提交 3c8a391f 作者: Jeromy

dont put wantlist getter in exchange interface

上级 98a183d5
......@@ -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
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论