core: allow to read states for non-contract verifications

C# does it this way now:
  callFlags = !witness.VerificationScript.IsStandardContract() ? CallFlags.ReadStates : CallFlags.None

So non-standard scripts _always_ have access to state and standards ones just
don't care (their code is known and it doesn't touch state).
This commit is contained in:
Roman Khimov 2021-02-03 22:37:24 +03:00
parent ac527650eb
commit ed3cef81cc

View file

@ -1744,7 +1744,7 @@ func (bc *Blockchain) initVerificationVM(ic *interop.Context, hash util.Uint160,
if bc.contracts.ByHash(hash) != nil {
return ErrNativeContractWitness
}
v.LoadScriptWithFlags(witness.VerificationScript, callflag.NoneFlag)
v.LoadScriptWithFlags(witness.VerificationScript, callflag.ReadStates)
} else {
cs, err := ic.GetContract(hash)
if err != nil {