public PayToScriptHashSigParameters ExtractScriptSigParameters(Script scriptSig, Script scriptPubKey) { var ops = scriptSig.ToOps().ToArray(); var ops2 = scriptPubKey == null ? null : scriptPubKey.ToOps().ToArray(); if (!CheckScriptSigCore(scriptSig, ops, scriptPubKey, ops2)) { return(null); } PayToScriptHashSigParameters result = new PayToScriptHashSigParameters(); result.RedeemScript = Script.FromBytesUnsafe(ops[ops.Length - 1].PushData); result.Pushes = ops.Take(ops.Length - 1).Select(o => o.PushData).ToArray(); return(result); }
public Script GenerateScriptSig(PayToScriptHashSigParameters parameters) { return(GenerateScriptSig(parameters.Pushes, parameters.RedeemScript)); }