dont put wantlist getter in exchange interface

This commit is contained in:
Jeromy 2015-02-23 11:47:49 -08:00
parent 98a183d53e
commit 3c8a391fe4
3 changed files with 6 additions and 8 deletions

View File

@ -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,

View File

@ -21,7 +21,5 @@ type Interface interface {
// available on the network?
HasBlock(context.Context, *blocks.Block) error
GetWantlist() []u.Key
io.Closer
}

View File

@ -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
}