mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-11 03:09:41 +08:00
fix(bitswap): handling of network notification
This commit is contained in:
parent
bbc54516bf
commit
faded10870
@ -342,6 +342,13 @@ func (bs *bitswap) ReceiveMessage(ctx context.Context, p peer.ID, incoming bsmsg
|
||||
// Connected/Disconnected warns bitswap about peer connections
|
||||
func (bs *bitswap) PeerConnected(p peer.ID) {
|
||||
// TODO: add to clientWorker??
|
||||
peers := make(chan peer.ID, 1)
|
||||
peers <- p
|
||||
close(peers)
|
||||
err := bs.sendWantlistToPeers(context.TODO(), peers)
|
||||
if err != nil {
|
||||
log.Errorf("error sending wantlist: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Connected/Disconnected warns bitswap about peer connections
|
||||
|
||||
Loading…
Reference in New Issue
Block a user