Skip to content

Commit

Permalink
dont put wantlist getter in exchange interface
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrusleeping committed Feb 25, 2015
1 parent fc7f018 commit 1af6a62
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
7 changes: 6 additions & 1 deletion core/commands/bitswap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions exchange/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,5 @@ type Interface interface {
// available on the network?
HasBlock(context.Context, *blocks.Block) error

GetWantlist() []u.Key

io.Closer
}
5 changes: 0 additions & 5 deletions exchange/offline/offline.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 1af6a62

Please sign in to comment.