Skip to content

Commit

Permalink
Merge pull request #624 from etclabscore/fix-sync-race
Browse files Browse the repository at this point in the history
eth: fix potential data race
  • Loading branch information
meowsbits authored Mar 13, 2024
2 parents 0e5f9f6 + 0880c5f commit dca3897
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eth/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ func (cs *chainSyncer) nextSyncOp() *chainSyncOp {
} else if minPeers > cs.handler.maxPeers {
minPeers = cs.handler.maxPeers
}
if cs.handler.peers.len() < minArtificialFinalityPeers {
if cs.handler.chain.IsArtificialFinalityEnabled() {
if cs.handler.chain.IsArtificialFinalityEnabled() {
if cs.handler.peers.len() < minArtificialFinalityPeers {
// If artificial finality state is forcefully set (overridden) this will just be a noop.
cs.handler.chain.EnableArtificialFinality(false, "reason", "low peers", "peers", cs.handler.peers.len())
}
Expand Down

0 comments on commit dca3897

Please sign in to comment.