diff --git a/p2p/enode/iter.go b/p2p/enode/iter.go index 112b76d06..664964f53 100644 --- a/p2p/enode/iter.go +++ b/p2p/enode/iter.go @@ -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 }