Skip to content

Commit 621dc2b

Browse files
authored
Merge pull request #4273 from nspcc-dev/fix-registerCandidate
2 parents 35f7cde + 4d6cc69 commit 621dc2b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

pkg/core/native/native_neo.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,14 @@ func (n *NEO) CalculateNEOHolderReward(d *dao.Simple, value *big.Int, start, end
868868

869869
func (n *NEO) registerCandidate(ic *interop.Context, args []stackitem.Item) stackitem.Item {
870870
pub := toPublicKey(args[0])
871+
if !ic.IsHardforkEnabled(config.HFEchidna) { // doesn't affect N3 states but affects execution result, so need to be kept, ref. #4262.
872+
ok, err := runtime.CheckKeyedWitness(ic, pub)
873+
if err != nil {
874+
panic(err)
875+
} else if !ok {
876+
return stackitem.NewBool(false)
877+
}
878+
}
871879
if err := ic.VM.AddDatoshi(n.getRegisterPriceInternal(ic.DAO)); err != nil {
872880
panic(fmt.Errorf("%w executing %s/registerCandidate", err, n.Hash.StringLE()))
873881
}

0 commit comments

Comments
 (0)