From c9dce0bfd769808f75aedbe119caa5f67be26b76 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Thu, 5 Dec 2019 22:16:35 +0100 Subject: [PATCH] p2p/enode: remove data race in sliceIter (#20421) --- p2p/enode/iter.go | 2 ++ 1 file changed, 2 insertions(+) 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 }