From c9acc43023368fa40868579e8b8fc938b61ffa9a Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 24 Nov 2020 12:08:25 +0300 Subject: [PATCH] core: invoke contract verification script with AllowStates flag We should call contract's `verify` with AllowStates flag. --- pkg/core/blockchain.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index d0c0a4007..6a3aeef5d 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -1590,6 +1590,7 @@ func (bc *Blockchain) initVerificationVM(ic *interop.Context, hash util.Uint160, var isNative bool var initMD *manifest.Method verification := witness.VerificationScript + flags := smartcontract.NoneFlag if len(verification) != 0 { if witness.ScriptHash() != hash { return ErrWitnessHashMismatch @@ -1610,10 +1611,11 @@ func (bc *Blockchain) initVerificationVM(ic *interop.Context, hash util.Uint160, offset = md.Offset initMD = cs.Manifest.ABI.GetMethod(manifest.MethodInit) isNative = cs.ID < 0 + flags = smartcontract.AllowStates } v := ic.VM - v.LoadScriptWithFlags(verification, smartcontract.NoneFlag) + v.LoadScriptWithFlags(verification, flags) v.Jump(v.Context(), offset) if isNative { w := io.NewBufBinWriter()