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

C# node uses Snapshot.GetAndChange to get it from storage, so it's the
same problem as with voting account. Affects dumps.
This commit is contained in:
Anna Shaleva 2021-03-29 17:06:37 +03:00
parent c63528db44
commit b7194ec608

View file

@ -738,6 +738,11 @@ func (n *NEO) VoteInternal(ic *interop.Context, h util.Uint160, pub *keys.Public
return errors.New("unknown validator")
}
cd := new(candidate).FromBytes(valSi)
// we should put it in storage anyway as it affects dumps
err = ic.DAO.PutStorageItem(n.ID, valKey, valSi)
if err != nil {
return err
}
if !cd.Registered {
return errors.New("validator must be registered")
}