Commit 5fb913d6 authored by Jeromy's avatar Jeromy

make wantlist updates to connected peers happen async, dramatically improves...

make wantlist updates to connected peers happen async, dramatically improves performance between connected nodes
parent 234cb05f
...@@ -369,10 +369,12 @@ func (bs *bitswap) wantNewBlocks(ctx context.Context, bkeys []u.Key) { ...@@ -369,10 +369,12 @@ func (bs *bitswap) wantNewBlocks(ctx context.Context, bkeys []u.Key) {
message.AddEntry(k, kMaxPriority-i) message.AddEntry(k, kMaxPriority-i)
} }
for _, p := range bs.engine.Peers() { for _, p := range bs.engine.Peers() {
go func(p peer.ID) {
err := bs.send(ctx, p, message) err := bs.send(ctx, p, message)
if err != nil { if err != nil {
log.Debugf("Error sending message: %s", err) log.Debugf("Error sending message: %s", err)
} }
}(p)
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment