mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-09 19:32:24 +08:00
bitswap: remove DialPeer from interface
Bitswap doesn't usually care about dialing. the underlying network adapter can make sure of that.
This commit is contained in:
@ -2,7 +2,6 @@ package bitswap
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
|
||||
bsmsg "github.com/jbenet/go-ipfs/exchange/bitswap/message"
|
||||
@ -178,14 +177,6 @@ func (nc *networkClient) Provide(ctx context.Context, k util.Key) error {
|
||||
return nc.routing.Provide(ctx, k)
|
||||
}
|
||||
|
||||
func (nc *networkClient) DialPeer(ctx context.Context, p peer.ID) error {
|
||||
// no need to do anything because dialing isn't a thing in this test net.
|
||||
if !nc.network.HasPeer(p) {
|
||||
return fmt.Errorf("Peer not in network: %s", p)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (nc *networkClient) SetDelegate(r bsnet.Receiver) {
|
||||
nc.Receiver = r
|
||||
}
|
||||
|
Reference in New Issue
Block a user