From 83cef85cab0d47e0c19f843d7acdb5ee16edf224 Mon Sep 17 00:00:00 2001 From: Brannon King Date: Mon, 16 Sep 2019 14:49:35 -0600 Subject: [PATCH] Fix broken test on previous checkin --- src/policy/policy.cpp | 2 +- src/script/sign.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp index 63eb81a69..9dafbca1f 100644 --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -165,7 +165,7 @@ bool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs) const CTxOut& prev = mapInputs.AccessCoin(tx.vin[i].prevout).out; std::vector > vSolutions; - const CScript& prevScript = prev.scriptPubKey; + const CScript& prevScript = StripClaimScriptPrefix(prev.scriptPubKey); txnouttype whichType = Solver(prevScript, vSolutions); if (whichType == TX_NONSTANDARD) { return false; diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 54716ed66..87ef55612 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -105,7 +105,8 @@ static bool SignStep(const SigningProvider& provider, const BaseSignatureCreator std::vector sig; std::vector vSolutions; - whichTypeRet = Solver(scriptPubKey, vSolutions); + auto stripped = StripClaimScriptPrefix(scriptPubKey); + whichTypeRet = Solver(stripped, vSolutions); switch (whichTypeRet) { @@ -195,7 +196,7 @@ bool ProduceSignature(const SigningProvider& provider, const BaseSignatureCreato std::vector result; txnouttype whichType; - bool solved = SignStep(provider, creator, StripClaimScriptPrefix(fromPubKey), result, whichType, SigVersion::BASE, sigdata); + bool solved = SignStep(provider, creator, fromPubKey, result, whichType, SigVersion::BASE, sigdata); bool P2SH = false; CScript subscript; sigdata.scriptWitness.stack.clear();