From 64284304461325507257cf5007b465e1a173a89f Mon Sep 17 00:00:00 2001 From: Diego Nava Date: Thu, 21 Sep 2023 16:57:53 +0200 Subject: [PATCH] use the updated state in case there is one --- core/preimages.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/preimages.go b/core/preimages.go index 663a50296..4e1d18447 100644 --- a/core/preimages.go +++ b/core/preimages.go @@ -229,12 +229,13 @@ func GeneratePreimages(chain BlockChain, start, end uint64) error { // because we have startingBlock we must have all following return fmt.Errorf("block %d not found", i) } + stateAt, _ := chain.StateAt(block.Root()) _, _, _, _, _, _, endingState, err := chain.Processor().Process(block, startingState, *chain.GetVMConfig(), false) if err != nil { return fmt.Errorf("error executing block #%d: %s", i, err) } - stateAt, err := chain.StateAt(block.Root()) - if err == nil && stateAt != nil { + + if stateAt != nil { startingState = stateAt } else { startingState = endingState