p2p/enode: remove data race in sliceIter (#20421)
This commit is contained in:
parent
e78f631dfc
commit
c9dce0bfd7
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user