core: put voiting account to the storage during (*NEO).vote

After getting account from the storage there are a lot of checks which
may fail. But C# node uses Snapshot.GetAndChange, so the account state
should be put in the storage even in case of vote failure. Affects
dumps.
This commit is contained in:
Anna Shaleva 2021-03-29 16:07:28 +03:00
parent 3d8d927178
commit c63528db44

View file

@ -726,6 +726,11 @@ func (n *NEO) VoteInternal(ic *interop.Context, h util.Uint160, pub *keys.Public
if err != nil {
return err
}
// we should put it in storage anyway as it affects dumps
err = ic.DAO.PutStorageItem(n.ID, key, si)
if err != nil {
return err
}
if pub != nil {
valKey := makeValidatorKey(pub)
valSi := ic.DAO.GetStorageItem(n.ID, valKey)