From ecda07736e74d5715c32e089df4c7075f818d185 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Fri, 18 Nov 2022 12:57:35 +0300 Subject: [PATCH] core: stop storage items reset after any seek error --- pkg/core/blockchain.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index b78e69f91..6161abb7d 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -796,13 +796,14 @@ func (bc *Blockchain) resetStateInternal(height uint32, stage stateChangeStage) err = stackitem.DeserializeConvertible(v, cs) if err != nil { seekErr = fmt.Errorf("failed to deserialize contract %s state: %w", hash.StringLE(), seekErr) + return false } cache.PutContractID(cs.ID, hash) cnt++ contractIDsCnt++ } - return seekErr == nil + return true }) if seekErr != nil { return fmt.Errorf("failed to reset contract contract storage items and IDs: %w", seekErr)