Skip to content

Commit

Permalink
add missing read lock (#1517)
Browse files Browse the repository at this point in the history
  • Loading branch information
baptiste-b-pegasys committed Sep 27, 2022
1 parent 0cca99e commit b574357
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions eth/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,8 @@ func (h *handler) getConsensusAlgorithm() string {

func (h *handler) FindPeers(targets map[common.Address]bool) map[common.Address]consensus.Peer {
m := make(map[common.Address]consensus.Peer)
h.peers.lock.RLock()
defer h.peers.lock.RUnlock()
for _, p := range h.peers.peers {
pubKey := p.Node().Pubkey()
addr := crypto.PubkeyToAddress(*pubKey)
Expand Down

0 comments on commit b574357

Please sign in to comment.