mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-28 09:30:57 +02:00
rpc, refactor: Add decodepsbt_inputs
This change eliminates memory usage spike when compiling with Visual Studio 2022 (at least in Cirrus CI environment). Easy to review using `git diff --color-moved-ws=allow-indentation-change --color-moved=dimmed-zebra`
This commit is contained in:
@@ -680,46 +680,8 @@ static RPCHelpMan signrawtransactionwithkey()
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static RPCHelpMan decodepsbt()
|
const RPCResult decodepsbt_inputs{
|
||||||
{
|
RPCResult::Type::ARR, "inputs", "",
|
||||||
return RPCHelpMan{
|
|
||||||
"decodepsbt",
|
|
||||||
"Return a JSON object representing the serialized, base64-encoded partially signed Bitcoin transaction.",
|
|
||||||
{
|
|
||||||
{"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, "The PSBT base64 string"},
|
|
||||||
},
|
|
||||||
RPCResult{
|
|
||||||
RPCResult::Type::OBJ, "", "",
|
|
||||||
{
|
|
||||||
{RPCResult::Type::OBJ, "tx", "The decoded network-serialized unsigned transaction.",
|
|
||||||
{
|
|
||||||
{RPCResult::Type::ELISION, "", "The layout is the same as the output of decoderawtransaction."},
|
|
||||||
}},
|
|
||||||
{RPCResult::Type::ARR, "global_xpubs", "",
|
|
||||||
{
|
|
||||||
{RPCResult::Type::OBJ, "", "",
|
|
||||||
{
|
|
||||||
{RPCResult::Type::STR, "xpub", "The extended public key this path corresponds to"},
|
|
||||||
{RPCResult::Type::STR_HEX, "master_fingerprint", "The fingerprint of the master key"},
|
|
||||||
{RPCResult::Type::STR, "path", "The path"},
|
|
||||||
}},
|
|
||||||
}},
|
|
||||||
{RPCResult::Type::NUM, "psbt_version", "The PSBT version number. Not to be confused with the unsigned transaction version"},
|
|
||||||
{RPCResult::Type::ARR, "proprietary", "The global proprietary map",
|
|
||||||
{
|
|
||||||
{RPCResult::Type::OBJ, "", "",
|
|
||||||
{
|
|
||||||
{RPCResult::Type::STR_HEX, "identifier", "The hex string for the proprietary identifier"},
|
|
||||||
{RPCResult::Type::NUM, "subtype", "The number for the subtype"},
|
|
||||||
{RPCResult::Type::STR_HEX, "key", "The hex for the key"},
|
|
||||||
{RPCResult::Type::STR_HEX, "value", "The hex for the value"},
|
|
||||||
}},
|
|
||||||
}},
|
|
||||||
{RPCResult::Type::OBJ_DYN, "unknown", "The unknown global fields",
|
|
||||||
{
|
|
||||||
{RPCResult::Type::STR_HEX, "key", "(key-value pair) An unknown key-value pair"},
|
|
||||||
}},
|
|
||||||
{RPCResult::Type::ARR, "inputs", "",
|
|
||||||
{
|
{
|
||||||
{RPCResult::Type::OBJ, "", "",
|
{RPCResult::Type::OBJ, "", "",
|
||||||
{
|
{
|
||||||
@@ -842,7 +804,49 @@ static RPCHelpMan decodepsbt()
|
|||||||
}},
|
}},
|
||||||
}},
|
}},
|
||||||
}},
|
}},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static RPCHelpMan decodepsbt()
|
||||||
|
{
|
||||||
|
return RPCHelpMan{
|
||||||
|
"decodepsbt",
|
||||||
|
"Return a JSON object representing the serialized, base64-encoded partially signed Bitcoin transaction.",
|
||||||
|
{
|
||||||
|
{"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, "The PSBT base64 string"},
|
||||||
|
},
|
||||||
|
RPCResult{
|
||||||
|
RPCResult::Type::OBJ, "", "",
|
||||||
|
{
|
||||||
|
{RPCResult::Type::OBJ, "tx", "The decoded network-serialized unsigned transaction.",
|
||||||
|
{
|
||||||
|
{RPCResult::Type::ELISION, "", "The layout is the same as the output of decoderawtransaction."},
|
||||||
}},
|
}},
|
||||||
|
{RPCResult::Type::ARR, "global_xpubs", "",
|
||||||
|
{
|
||||||
|
{RPCResult::Type::OBJ, "", "",
|
||||||
|
{
|
||||||
|
{RPCResult::Type::STR, "xpub", "The extended public key this path corresponds to"},
|
||||||
|
{RPCResult::Type::STR_HEX, "master_fingerprint", "The fingerprint of the master key"},
|
||||||
|
{RPCResult::Type::STR, "path", "The path"},
|
||||||
|
}},
|
||||||
|
}},
|
||||||
|
{RPCResult::Type::NUM, "psbt_version", "The PSBT version number. Not to be confused with the unsigned transaction version"},
|
||||||
|
{RPCResult::Type::ARR, "proprietary", "The global proprietary map",
|
||||||
|
{
|
||||||
|
{RPCResult::Type::OBJ, "", "",
|
||||||
|
{
|
||||||
|
{RPCResult::Type::STR_HEX, "identifier", "The hex string for the proprietary identifier"},
|
||||||
|
{RPCResult::Type::NUM, "subtype", "The number for the subtype"},
|
||||||
|
{RPCResult::Type::STR_HEX, "key", "The hex for the key"},
|
||||||
|
{RPCResult::Type::STR_HEX, "value", "The hex for the value"},
|
||||||
|
}},
|
||||||
|
}},
|
||||||
|
{RPCResult::Type::OBJ_DYN, "unknown", "The unknown global fields",
|
||||||
|
{
|
||||||
|
{RPCResult::Type::STR_HEX, "key", "(key-value pair) An unknown key-value pair"},
|
||||||
|
}},
|
||||||
|
decodepsbt_inputs,
|
||||||
{RPCResult::Type::ARR, "outputs", "",
|
{RPCResult::Type::ARR, "outputs", "",
|
||||||
{
|
{
|
||||||
{RPCResult::Type::OBJ, "", "",
|
{RPCResult::Type::OBJ, "", "",
|
||||||
|
Reference in New Issue
Block a user