From 7a3cbda84899191f3d6397b54aadd1686becfc5c Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Sun, 19 Sep 2021 13:49:40 +0000 Subject: [PATCH] sign.cpp: turn on SIGHASH_SCRIPT_RANGEPROOF when checking already-existing signatures Currently when a user uses `signrawtransaction` on a transaction that is already partially signed with SIGHASH_RANGEPROOF signatures, the existing signatures will be deleted because they are not recognized as valid. This makes it impossible to collabratively sign transactions using this RPC. Fix this. --- src/script/sign.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 940bd6a65e..83af10e1a3 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -310,7 +310,7 @@ SignatureData DataFromTransaction(const CMutableTransaction& tx, unsigned int nI // Get signatures MutableTransactionSignatureChecker tx_checker(&tx, nIn, txout.nValue); SignatureExtractorChecker extractor_checker(data, tx_checker); - if (VerifyScript(data.scriptSig, txout.scriptPubKey, &data.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS, extractor_checker)) { + if (VerifyScript(data.scriptSig, txout.scriptPubKey, &data.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS | SCRIPT_SIGHASH_RANGEPROOF, extractor_checker)) { data.complete = true; return data; }