mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-27 03:58:06 +00:00
core: fix contract's state migration and don't swallow errors
Fixes difference in state changes at mainnet's block 2442790 because contract migration in b4eb2dc35226e6520ee4e09a56197dff91547b50a7f57edc82930fc18c75dffc doesn't actually transfer the storage state, it only deletes the old one. And add an error check just in case.
This commit is contained in:
parent
ba1c3bfccb
commit
e6e8761d35
1 changed files with 4 additions and 1 deletions
|
@ -579,7 +579,10 @@ func (ic *interopContext) contractMigrate(v *vm.VM) error {
|
|||
}
|
||||
for k, v := range siMap {
|
||||
v.IsConst = false
|
||||
_ = ic.dao.PutStorageItem(hash, []byte(k), v)
|
||||
err = ic.dao.PutStorageItem(contract.ScriptHash(), []byte(k), v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue