Skip to content

Commit

Permalink
fix race
Browse files Browse the repository at this point in the history
  • Loading branch information
vgonkivs committed Feb 1, 2024
1 parent 192ef48 commit 6e185c4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions p2p/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ func (ex *Exchange[H]) Head(ctx context.Context, opts ...header.HeadOption[H]) (
headerRespCh = make(chan H, len(peers))
)
for _, from := range peers {
ctx := ctx
go func(from peer.ID) {
// can skip error handling here as it returns an error if sanity check fails.
// we can be sure that our strings are ok.
Expand Down

0 comments on commit 6e185c4

Please sign in to comment.