aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wallet/rpc/spend.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wallet/rpc/spend.cpp b/src/wallet/rpc/spend.cpp
index 0c2be26ddf..c4206e9897 100644
--- a/src/wallet/rpc/spend.cpp
+++ b/src/wallet/rpc/spend.cpp
@@ -1566,6 +1566,7 @@ RPCHelpMan walletprocesspsbt()
{
{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{
@@ -1609,6 +1610,14 @@ RPCHelpMan walletprocesspsbt()
ssTx << psbtx;
result.pushKV("psbt", EncodeBase64(ssTx.str()));
result.pushKV("complete", complete);
+ if (complete) {
+ CMutableTransaction mtx;
+ // Returns true if complete, which we already think it is.
+ CHECK_NONFATAL(FinalizeAndExtractPSBT(psbtx, mtx));
+ CDataStream ssTx_final(SER_NETWORK, PROTOCOL_VERSION);
+ ssTx_final << mtx;
+ result.pushKV("hex", HexStr(ssTx_final));
+ }
return result;
},