From 7629ad7ec7f40a21ee3b134f6504122a8052fbc2 Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet Date: Sat, 3 Jan 2015 03:01:17 -0800 Subject: [PATCH] bitswap: add self peer.ID --- exchange/bitswap/bitswap.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exchange/bitswap/bitswap.go b/exchange/bitswap/bitswap.go index fe20a406a..cea618970 100644 --- a/exchange/bitswap/bitswap.go +++ b/exchange/bitswap/bitswap.go @@ -61,6 +61,7 @@ func New(parent context.Context, p peer.ID, network bsnet.BitSwapNetwork, }() bs := &bitswap{ + self: p, blockstore: bstore, cancelFunc: cancelFunc, notifications: notif, @@ -79,6 +80,9 @@ func New(parent context.Context, p peer.ID, network bsnet.BitSwapNetwork, // bitswap instances implement the bitswap protocol. type bitswap struct { + // the ID of the peer to act on behalf of + self peer.ID + // network delivers messages on behalf of the session network bsnet.BitSwapNetwork