Skip to content

Commit 235b042

Browse files
MarcoFalkejonatack
MarcoFalke
authored andcommitted
rpc: Exclude descriptor when address is excluded
Github-Pull: bitcoin#24636 Rebased-From: faf37c2
1 parent b05a59b commit 235b042

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/core_write.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool include
153153
CTxDestination address;
154154

155155
out.pushKV("asm", ScriptToAsmStr(scriptPubKey));
156-
out.pushKV("desc", InferDescriptor(scriptPubKey, DUMMY_SIGNING_PROVIDER)->ToString());
156+
if (include_address) {
157+
out.pushKV("desc", InferDescriptor(scriptPubKey, DUMMY_SIGNING_PROVIDER)->ToString());
158+
}
157159
if (include_hex) out.pushKV("hex", HexStr(scriptPubKey));
158160

159161
std::vector<std::vector<unsigned char>> solns;

src/rpc/rawtransaction.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,7 @@ static RPCHelpMan decodepsbt()
11211121
{RPCResult::Type::OBJ, "scriptPubKey", "",
11221122
{
11231123
{RPCResult::Type::STR, "asm", "The asm"},
1124+
{RPCResult::Type::STR, "desc", "Inferred descriptor for the output"},
11241125
{RPCResult::Type::STR_HEX, "hex", "The hex"},
11251126
{RPCResult::Type::STR, "type", "The type, eg 'pubkeyhash'"},
11261127
{RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},

0 commit comments

Comments
 (0)