aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2021-01-25 16:49:44 -0500
committerAndrew Chow <achow101-github@achow101.com>2021-12-10 08:29:26 -0500
commit10ba0b593d3c9bc03e36d52344237be6e89c443f (patch)
treedd17addbd8190ac0e36e08d9ab62c13f9ed5bdcd
parentdf84fa99c5a52e4688e240c585f7d22b20401906 (diff)
Output psbt version in decodepsbt
-rw-r--r--src/rpc/rawtransaction.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index 78c1596219..253ff37466 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -1075,6 +1075,7 @@ static RPCHelpMan decodepsbt()
{
{RPCResult::Type::ELISION, "", "The layout is the same as the output of decoderawtransaction."},
}},
+ {RPCResult::Type::NUM, "psbt_version", "The PSBT version number. Not to be confused with the unsigned transaction version"},
{RPCResult::Type::OBJ_DYN, "unknown", "The unknown global fields",
{
{RPCResult::Type::STR_HEX, "key", "(key-value pair) An unknown key-value pair"},
@@ -1194,6 +1195,9 @@ static RPCHelpMan decodepsbt()
TxToUniv(CTransaction(*psbtx.tx), uint256(), tx_univ, false);
result.pushKV("tx", tx_univ);
+ // PSBT version
+ result.pushKV("psbt_version", static_cast<uint64_t>(psbtx.GetVersion()));
+
// Unknown data
UniValue unknowns(UniValue::VOBJ);
for (auto entry : psbtx.unknown) {