rpc: Exclude descriptor when address is excluded

pull/24636/head
MarcoFalke 3 years ago
parent d6f225f5c9
commit faf37c217a
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548

@ -153,7 +153,9 @@ void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool include
CTxDestination address; CTxDestination address;
out.pushKV("asm", ScriptToAsmStr(scriptPubKey)); out.pushKV("asm", ScriptToAsmStr(scriptPubKey));
out.pushKV("desc", InferDescriptor(scriptPubKey, DUMMY_SIGNING_PROVIDER)->ToString()); if (include_address) {
out.pushKV("desc", InferDescriptor(scriptPubKey, DUMMY_SIGNING_PROVIDER)->ToString());
}
if (include_hex) out.pushKV("hex", HexStr(scriptPubKey)); if (include_hex) out.pushKV("hex", HexStr(scriptPubKey));
std::vector<std::vector<unsigned char>> solns; std::vector<std::vector<unsigned char>> solns;

@ -1121,6 +1121,7 @@ static RPCHelpMan decodepsbt()
{RPCResult::Type::OBJ, "scriptPubKey", "", {RPCResult::Type::OBJ, "scriptPubKey", "",
{ {
{RPCResult::Type::STR, "asm", "The asm"}, {RPCResult::Type::STR, "asm", "The asm"},
{RPCResult::Type::STR, "desc", "Inferred descriptor for the output"},
{RPCResult::Type::STR_HEX, "hex", "The hex"}, {RPCResult::Type::STR_HEX, "hex", "The hex"},
{RPCResult::Type::STR, "type", "The type, eg 'pubkeyhash'"}, {RPCResult::Type::STR, "type", "The type, eg 'pubkeyhash'"},
{RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"}, {RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},

Loading…
Cancel
Save