wallet, rpc: Push the normalized parent descriptor

Instead of providing the descriptor string as stored in the db, use the
normalized descriptor as is done for getaddressinfo's parent_desc field.
This commit is contained in:
Ava Chow
2025-05-12 16:19:31 -07:00
parent 2df824f4e6
commit 3fc9d9f241

View File

@ -109,7 +109,10 @@ void PushParentDescriptors(const CWallet& wallet, const CScript& script_pubkey,
{
UniValue parent_descs(UniValue::VARR);
for (const auto& desc: wallet.GetWalletDescriptors(script_pubkey)) {
parent_descs.push_back(desc.descriptor->ToString());
std::string desc_str;
FlatSigningProvider dummy_provider;
if (!CHECK_NONFATAL(desc.descriptor->ToNormalizedString(dummy_provider, desc_str, &desc.cache))) continue;
parent_descs.push_back(desc_str);
}
entry.pushKV("parent_descs", std::move(parent_descs));
}