mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
rpc: Exclude descriptor when address is excluded
This commit is contained in:
@@ -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));
|
||||||
|
if (include_address) {
|
||||||
out.pushKV("desc", InferDescriptor(scriptPubKey, DUMMY_SIGNING_PROVIDER)->ToString());
|
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)"},
|
||||||
|
|||||||
Reference in New Issue
Block a user