Commit 5eb9aaa3 authored by Adin Schmahmann's avatar Adin Schmahmann

fullrt: execOnMany abort early if executing on no peers

parent 0da80650
......@@ -831,6 +831,10 @@ func (dht *FullRT) Provide(ctx context.Context, key cid.Cid, brdcst bool) (err e
}
func (dht *FullRT) execOnMany(ctx context.Context, fn func(context.Context, peer.ID) error, peers []peer.ID) int {
if len(peers) == 0 {
return 0
}
putctx, cancel := context.WithCancel(ctx)
defer cancel()
......
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