From 3fc9d9f241a44ab64774aa9ddc3ded4bb589ed5a Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Mon, 12 May 2025 16:19:31 -0700 Subject: [PATCH] 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. --- src/wallet/rpc/util.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wallet/rpc/util.cpp b/src/wallet/rpc/util.cpp index 219378cfd44..e5cbfeafb9e 100644 --- a/src/wallet/rpc/util.cpp +++ b/src/wallet/rpc/util.cpp @@ -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)); }