diff --git a/pkg/core/interop/runtime/witness.go b/pkg/core/interop/runtime/witness.go index c2b2917c5..d95042ef6 100644 --- a/pkg/core/interop/runtime/witness.go +++ b/pkg/core/interop/runtime/witness.go @@ -19,17 +19,7 @@ func CheckHashedWitness(ic *interop.Context, hash util.Uint160) (bool, error) { return checkScope(ic.DAO, tx, ic.ScriptGetter, hash) } - // only for non-Transaction types (Block, etc.) - hashes, err := ic.Chain.GetScriptHashesForVerifying(ic.Tx) - if err != nil { - return false, errors.Wrap(err, "failed to get script hashes") - } - for _, v := range hashes { - if hash.Equals(v) { - return true, nil - } - } - return false, nil + return false, errors.New("script container is not a transaction") } func checkScope(d dao.DAO, tx *transaction.Transaction, v vm.ScriptHashGetter, hash util.Uint160) (bool, error) { diff --git a/pkg/core/interops.go b/pkg/core/interops.go index 750713ce5..1ca854529 100644 --- a/pkg/core/interops.go +++ b/pkg/core/interops.go @@ -110,7 +110,8 @@ var systemInterops = []interop.Function{ {Name: "System.Iterator.Values", Func: iterator.Values, Price: 400}, {Name: "System.Json.Deserialize", Func: json.Deserialize, Price: 500000}, {Name: "System.Json.Serialize", Func: json.Serialize, Price: 100000}, - {Name: "System.Runtime.CheckWitness", Func: runtime.CheckWitness, Price: 30000}, + {Name: "System.Runtime.CheckWitness", Func: runtime.CheckWitness, Price: 30000, + RequiredFlags: smartcontract.AllowStates}, {Name: "System.Runtime.GasLeft", Func: runtime.GasLeft, Price: 400}, {Name: "System.Runtime.GetCallingScriptHash", Func: engineGetCallingScriptHash, Price: 400}, {Name: "System.Runtime.GetEntryScriptHash", Func: engineGetEntryScriptHash, Price: 400},