p2p/enode: remove data race in sliceIter (#20421)
This commit is contained in:
parent
0c7ae69814
commit
04998d12a5
@ -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