Merge pull request #2615 from nspcc-dev/fix-candidate-register

native: trigger committee update on candidate registration
This commit is contained in:
Roman Khimov 2022-07-28 12:11:53 +03:00 committed by GitHub
commit a5afa87571
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -759,6 +759,8 @@ func (n *NEO) RegisterCandidateInternal(ic *interop.Context, pub *keys.PublicKey
} }
err := putConvertibleToDAO(n.ID, ic.DAO, key, c) err := putConvertibleToDAO(n.ID, ic.DAO, key, c)
if emitEvent { if emitEvent {
cache := ic.DAO.GetRWCache(n.ID).(*NeoCache)
cache.votesChanged = true
ic.AddNotification(n.Hash, "CandidateStateChanged", stackitem.NewArray([]stackitem.Item{ ic.AddNotification(n.Hash, "CandidateStateChanged", stackitem.NewArray([]stackitem.Item{
stackitem.NewByteArray(pub.Bytes()), stackitem.NewByteArray(pub.Bytes()),
stackitem.NewBool(c.Registered), stackitem.NewBool(c.Registered),