mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
p2p/enode: remove data race in sliceIter (#20421)
This commit is contained in:
parent
e78f631dfc
commit
c9dce0bfd7
1 changed files with 2 additions and 0 deletions
|
|
@ -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 a new issue