diff options
Diffstat (limited to 'src/rpc/rawtransaction.cpp')
-rw-r--r-- | src/rpc/rawtransaction.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index fa5dd281a1..31ca126862 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -1949,6 +1949,7 @@ RPCHelpMan descriptorprocesspsbt() { {RPCResult::Type::STR, "psbt", "The base64-encoded partially signed transaction"}, {RPCResult::Type::BOOL, "complete", "If the transaction has a complete set of signatures"}, + {RPCResult::Type::STR_HEX, "hex", /*optional=*/true, "The hex-encoded network transaction if complete"}, } }, RPCExamples{ @@ -1989,7 +1990,14 @@ RPCHelpMan descriptorprocesspsbt() result.pushKV("psbt", EncodeBase64(ssTx)); result.pushKV("complete", complete); - + if (complete) { + CMutableTransaction mtx; + PartiallySignedTransaction psbtx_copy = psbtx; + CHECK_NONFATAL(FinalizeAndExtractPSBT(psbtx_copy, mtx)); + CDataStream ssTx_final(SER_NETWORK, PROTOCOL_VERSION); + ssTx_final << mtx; + result.pushKV("hex", HexStr(ssTx_final)); + } return result; }, }; |