From 8e9bd3e28fee43bb5a3acaf755c21d4bf5c075f8 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 27 Jul 2022 23:21:21 +0300 Subject: [PATCH] native: trigger committee update on candidate registration It can change the committee even if noone voted. Fixes state diff at block 390726 of T5 testnet where there are no transactions, but committee changes because there were some registrations in previous 21 blocks. --- pkg/core/native/native_neo.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/core/native/native_neo.go b/pkg/core/native/native_neo.go index 7020accc1..756f308ef 100644 --- a/pkg/core/native/native_neo.go +++ b/pkg/core/native/native_neo.go @@ -759,6 +759,8 @@ func (n *NEO) RegisterCandidateInternal(ic *interop.Context, pub *keys.PublicKey } err := putConvertibleToDAO(n.ID, ic.DAO, key, c) if emitEvent { + cache := ic.DAO.GetRWCache(n.ID).(*NeoCache) + cache.votesChanged = true ic.AddNotification(n.Hash, "CandidateStateChanged", stackitem.NewArray([]stackitem.Item{ stackitem.NewByteArray(pub.Bytes()), stackitem.NewBool(c.Registered),