Skip to content

Commit 10ba0b5

Browse files
committed
Output psbt version in decodepsbt
1 parent df84fa9 commit 10ba0b5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,7 @@ static RPCHelpMan decodepsbt()
10751075
{
10761076
{RPCResult::Type::ELISION, "", "The layout is the same as the output of decoderawtransaction."},
10771077
}},
1078+
{RPCResult::Type::NUM, "psbt_version", "The PSBT version number. Not to be confused with the unsigned transaction version"},
10781079
{RPCResult::Type::OBJ_DYN, "unknown", "The unknown global fields",
10791080
{
10801081
{RPCResult::Type::STR_HEX, "key", "(key-value pair) An unknown key-value pair"},
@@ -1194,6 +1195,9 @@ static RPCHelpMan decodepsbt()
11941195
TxToUniv(CTransaction(*psbtx.tx), uint256(), tx_univ, false);
11951196
result.pushKV("tx", tx_univ);
11961197

1198+
// PSBT version
1199+
result.pushKV("psbt_version", static_cast<uint64_t>(psbtx.GetVersion()));
1200+
11971201
// Unknown data
11981202
UniValue unknowns(UniValue::VOBJ);
11991203
for (auto entry : psbtx.unknown) {

0 commit comments

Comments
 (0)