Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
p2p/enode: remove data race in sliceIter (ethereum#20421)
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusVanDerWijden authored and elizabethengelman committed Dec 20, 2019
1 parent 24ebeb4 commit 1ffa09a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions p2p/enode/iter.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ func (it *sliceIter) Next() bool {
}

func (it *sliceIter) Node() *Node {
it.mu.Lock()
defer it.mu.Unlock()
if len(it.nodes) == 0 {
return nil
}
Expand Down

0 comments on commit 1ffa09a

Please sign in to comment.