From 248e1132b26c6d6fc14e35583e307bdb4dd4c0be Mon Sep 17 00:00:00 2001 From: Glenn Willen Date: Fri, 26 Oct 2018 15:30:50 -0700 Subject: [PATCH] Simplify arguments to SignPSBTInput Remove redundant arguments to SignPSBTInput -- since it needs several bits of the PartiallySignedTransaction, pass in a reference instead of doing it piecemeal. This saves us having to pass in both a PSBTInput and its index, as well as having to pass in the CTransaction. Also avoid redundantly passing the sighash_type, which is contained in the PSBTInput already. Github-Pull: #14588 Rebased-From: 0f5bda2bd941686620ef0eb90bd7ed973cc7ef73 --- src/rpc/rawtransaction.cpp | 1 - src/script/sign.cpp | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 0b79bdd6f..20d0d22bd 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -1312,7 +1312,6 @@ UniValue finalizepsbt(const JSONRPCRequest& request) // signature, but have not combined them yet (e.g. because the combiner that created this // PartiallySignedTransaction did not understand them), this will combine them into a final // script. - CMutableTransaction mtx; bool complete = FinalizeAndExtractPSBT(psbtx, mtx); diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 0d3b7bfce..a7e6912ad 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -249,6 +249,9 @@ namespace { return !input.final_script_sig.empty() || !input.final_script_witness.IsNull(); } + PSBTInput& input = psbt.inputs.at(index); + const CMutableTransaction& tx = *psbt.tx; + class SignatureExtractorChecker final : public BaseSignatureChecker { private: