Skip to content

Commit

Permalink
core/forkchoice: improve stability when inturn block not generated (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanBSC authored Jun 18, 2024
1 parent 7b08a70 commit 00f094c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/forkchoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ func (f *ForkChoice) ReorgNeeded(current *types.Header, extern *types.Header) (b
if f.preserve != nil {
currentPreserve, externPreserve = f.preserve(current), f.preserve(extern)
}
reorg = !currentPreserve && (externPreserve || f.rand.Float64() < 0.5)
reorg = !currentPreserve && (externPreserve ||
extern.Time < current.Time ||
extern.Time == current.Time && f.rand.Float64() < 0.5)
}
return reorg, nil
}
Expand Down

0 comments on commit 00f094c

Please sign in to comment.