@cryptotaxi247 / kubo / commits / 7629ad7ec

bitswap: add self peer.ID

Juan Batiz-Benet committed Jan 3, 2015 at 03:01 UTC 7629ad7ec7f40a21ee3b134f6504122a8052fbc2
1 file changed +4
exchange/bitswap/bitswap.go
+4
@@ -61,6 +61,7 @@ func New(parent context.Context, p peer.ID, network bsnet.BitSwapNetwork,
61 }()
62
63 bs := &bitswap{
64 + self: p,
65 blockstore: bstore,
66 cancelFunc: cancelFunc,
67 notifications: notif,
@@ -79,6 +80,9 @@ func New(parent context.Context, p peer.ID, network bsnet.BitSwapNetwork,
80 // bitswap instances implement the bitswap protocol.
81 type bitswap struct {
82
83 + // the ID of the peer to act on behalf of
84 + self peer.ID
85 +
86 // network delivers messages on behalf of the session
87 network bsnet.BitSwapNetwork
88