Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
fixed accumulator nil case (ledgerwatch#4773)
Browse files Browse the repository at this point in the history
Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
  • Loading branch information
Giulio2002 and giuliorebuffo committed Jul 21, 2022
1 parent 73b028a commit 7573a41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion turbo/engineapi/fork_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (fv *ForkValidator) Clear() {
func (fv *ForkValidator) ClearWithUnwind(tx kv.RwTx, accumulator *shards.Accumulator, c shards.StateChangeConsumer) {
sb, ok := fv.sideForksBlock[fv.extendingForkHeadHash]
// If we did not flush the fork state, then we need to notify the txpool through unwind.
if fv.extendingFork != nil && fv.extendingForkHeadHash != (common.Hash{}) && ok {
if fv.extendingFork != nil && accumulator != nil && fv.extendingForkHeadHash != (common.Hash{}) && ok {
fv.extendingFork.UpdateTxn(tx)
// this will call unwind of extending fork to notify txpool of reverting transactions.
if err := fv.rewindAccumulator(sb.header.Number.Uint64()-1, accumulator, c); err != nil {
Expand Down

0 comments on commit 7573a41

Please sign in to comment.