Skip to content

Commit

Permalink
More fix
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang committed Oct 11, 2020
1 parent fcf8fc3 commit 976756e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/neo/SmartContract/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,17 @@ internal static bool VerifyWitnesses(this IVerifiable verifiable, StoreView snap
{
CallFlags callFlags = verifiable.Witnesses[i].StateDependent ? CallFlags.AllowStates : CallFlags.None;
ExecutionContext context = engine.LoadScript(verification, callFlags, offset);
if (init != null) engine.LoadContext(context.Clone(init.Offset), false);
if (NativeContract.IsNative(hashes[i]))
{
using ScriptBuilder sb = new ScriptBuilder();
sb.Emit(OpCode.DEPTH, OpCode.PACK);
sb.EmitPush("verify");
engine.LoadScript(sb.ToArray(), CallFlags.None);
}
else if (init != null)
{
engine.LoadContext(context.Clone(init.Offset), false);
}
engine.LoadScript(verifiable.Witnesses[i].InvocationScript, CallFlags.None);
if (engine.Execute() == VMState.FAULT) return false;
if (engine.ResultStack.Count != 1 || !engine.ResultStack.Pop().GetBoolean()) return false;
Expand Down

0 comments on commit 976756e

Please sign in to comment.