Commit c60d0117 authored by Brian Tiger Chow's avatar Brian Tiger Chow

fix(exchange) add context to DialPeer

parent 9d7e0bbd
......@@ -91,7 +91,7 @@ func (bs *bitswap) Block(parent context.Context, k u.Key) (*blocks.Block, error)
go func(p peer.Peer) {
log.Debugf("bitswap dialing peer: %s", p)
err := bs.sender.DialPeer(p)
err := bs.sender.DialPeer(ctx, p)
if err != nil {
log.Errorf("Error sender.DialPeer(%s)", p)
return
......
......@@ -12,7 +12,7 @@ import (
type Adapter interface {
// DialPeer ensures there is a connection to peer.
DialPeer(peer.Peer) error
DialPeer(context.Context, peer.Peer) error
// SendMessage sends a BitSwap message to a peer.
SendMessage(
......
......@@ -67,7 +67,7 @@ func (adapter *impl) HandleMessage(
return outgoing
}
func (adapter *impl) DialPeer(p peer.Peer) error {
func (adapter *impl) DialPeer(ctx context.Context, p peer.Peer) error {
return adapter.net.DialPeer(p)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment