From c63528db44573953f827689447a3075877e1d8c6 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 29 Mar 2021 16:07:28 +0300 Subject: [PATCH] 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. --- pkg/core/native/native_neo.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/core/native/native_neo.go b/pkg/core/native/native_neo.go index 295a9d8f7..5338abf87 100644 --- a/pkg/core/native/native_neo.go +++ b/pkg/core/native/native_neo.go @@ -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)