mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-28 17:03:58 +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{
|
||||
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
|
||||
|
||||
|
Reference in New Issue
Block a user