1
0
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:
Juan Batiz-Benet
2015-01-04 13:56:38 -08:00
parent f6def11eb3
commit aeb2e07198
4 changed files with 12 additions and 21 deletions

View File

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