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() {
err := bs.send(ctx, p, message) go func(p peer.ID) {
if err != nil { err := bs.send(ctx, p, message)
log.Debugf("Error sending message: %s", err) if err != nil {
} 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