rpc: Exclude descriptor when address is excluded

Github-Pull: bitcoin#24636
Rebased-From: faf37c2
This commit is contained in:
MarcoFalke 2022-03-22 11:49:58 +01:00 committed by Thomas Trevethan
parent ccb3a3e636
commit e8941f064a
2 changed files with 6 additions and 3 deletions

View file

@ -192,9 +192,11 @@ static void SidechainScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& o
const std::string prefix = is_parent_chain ? "pegout_" : "";
CTxDestination address;
out.pushKV(prefix + "asm", ScriptToAsmStr(scriptPubKey));
out.pushKV(prefix + "desc", InferDescriptor(scriptPubKey, DUMMY_SIGNING_PROVIDER)->ToString());
if (include_hex) out.pushKV(prefix + "hex", HexStr(scriptPubKey));
out.pushKV("asm", ScriptToAsmStr(scriptPubKey));
if (include_addresses) {
out.pushKV("desc", InferDescriptor(scriptPubKey, DUMMY_SIGNING_PROVIDER)->ToString());
}
if (include_hex) out.pushKV("hex", HexStr(scriptPubKey));
std::vector<std::vector<unsigned char>> solns;
const TxoutType type{Solver(scriptPubKey, solns)};