@@ -3663,6 +3663,7 @@ UniValue getaddressinfo(const JSONRPCRequest& request)
3663
3663
{RPCResult::Type::BOOL, " iswatchonly" , " If the address is watchonly." },
3664
3664
{RPCResult::Type::BOOL, " solvable" , " If we know how to spend coins sent to this address, ignoring the possible lack of private keys." },
3665
3665
{RPCResult::Type::STR, " desc" , /* optional */ true , " A descriptor for spending coins sent to this address (only when solvable)." },
3666
+ {RPCResult::Type::STR, " parent_desc" , /* optional */ true , " The descriptor used to derive this address if this is a descriptor wallet" },
3666
3667
{RPCResult::Type::BOOL, " isscript" , " If the key is a script." },
3667
3668
{RPCResult::Type::BOOL, " ischange" , " If the address was used for change output." },
3668
3669
{RPCResult::Type::BOOL, " iswitness" , " If the address is a witness address." },
@@ -3732,6 +3733,14 @@ UniValue getaddressinfo(const JSONRPCRequest& request)
3732
3733
ret.pushKV (" desc" , InferDescriptor (scriptPubKey, *provider)->ToString ());
3733
3734
}
3734
3735
3736
+ DescriptorScriptPubKeyMan* desc_spk_man = dynamic_cast <DescriptorScriptPubKeyMan*>(pwallet->GetScriptPubKeyMan (scriptPubKey));
3737
+ if (desc_spk_man) {
3738
+ std::string desc_str;
3739
+ if (desc_spk_man->GetDescriptorString (desc_str, false )) {
3740
+ ret.pushKV (" parent_desc" , desc_str);
3741
+ }
3742
+ }
3743
+
3735
3744
ret.pushKV (" iswatchonly" , bool (mine & ISMINE_WATCH_ONLY));
3736
3745
3737
3746
UniValue detail = DescribeWalletAddress (pwallet, dest);
0 commit comments