diff --git a/src/core_write.cpp b/src/core_write.cpp index 1771ebe0de..3edd25738b 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -192,7 +192,9 @@ static void SidechainScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& o CTxDestination address; out.pushKV(prefix + "asm", ScriptToAsmStr(scriptPubKey)); - out.pushKV(prefix + "desc", InferDescriptor(scriptPubKey, DUMMY_SIGNING_PROVIDER)->ToString()); + if (include_addresses) { + out.pushKV(prefix + "desc", InferDescriptor(scriptPubKey, DUMMY_SIGNING_PROVIDER)->ToString()); + } if (include_hex) out.pushKV(prefix + "hex", HexStr(scriptPubKey)); std::vector> solns; diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index f71442b81c..a9a8aa553a 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -1052,6 +1052,7 @@ static RPCHelpMan decodepsbt() {RPCResult::Type::OBJ, "scriptPubKey", "", { {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, "type", "The type, eg 'pubkeyhash'"}, {RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},