core: stop storage items reset after any seek error

This commit is contained in:
Anna Shaleva 2022-11-18 12:57:35 +03:00
parent bfe7aeae7b
commit ecda07736e

View file

@ -796,13 +796,14 @@ func (bc *Blockchain) resetStateInternal(height uint32, stage stateChangeStage)
err = stackitem.DeserializeConvertible(v, cs) err = stackitem.DeserializeConvertible(v, cs)
if err != nil { if err != nil {
seekErr = fmt.Errorf("failed to deserialize contract %s state: %w", hash.StringLE(), seekErr) seekErr = fmt.Errorf("failed to deserialize contract %s state: %w", hash.StringLE(), seekErr)
return false
} }
cache.PutContractID(cs.ID, hash) cache.PutContractID(cs.ID, hash)
cnt++ cnt++
contractIDsCnt++ contractIDsCnt++
} }
return seekErr == nil return true
}) })
if seekErr != nil { if seekErr != nil {
return fmt.Errorf("failed to reset contract contract storage items and IDs: %w", seekErr) return fmt.Errorf("failed to reset contract contract storage items and IDs: %w", seekErr)