mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-29 01:12:24 +08:00
bitswap: add self peer.ID
This commit is contained in:
@ -61,6 +61,7 @@ func New(parent context.Context, p peer.ID, network bsnet.BitSwapNetwork,
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
bs := &bitswap{
|
bs := &bitswap{
|
||||||
|
self: p,
|
||||||
blockstore: bstore,
|
blockstore: bstore,
|
||||||
cancelFunc: cancelFunc,
|
cancelFunc: cancelFunc,
|
||||||
notifications: notif,
|
notifications: notif,
|
||||||
@ -79,6 +80,9 @@ func New(parent context.Context, p peer.ID, network bsnet.BitSwapNetwork,
|
|||||||
// bitswap instances implement the bitswap protocol.
|
// bitswap instances implement the bitswap protocol.
|
||||||
type bitswap struct {
|
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 delivers messages on behalf of the session
|
||||||
network bsnet.BitSwapNetwork
|
network bsnet.BitSwapNetwork
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user