mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-02 15:32:34 +02:00
Report address as solvable based on inferred descriptor
This commit is contained in:
parent
29e5dd1a5b
commit
c7388e5ada
@ -3848,13 +3848,18 @@ RPCHelpMan getaddressinfo()
|
|||||||
isminetype mine = pwallet->IsMine(dest);
|
isminetype mine = pwallet->IsMine(dest);
|
||||||
ret.pushKV("ismine", bool(mine & ISMINE_SPENDABLE));
|
ret.pushKV("ismine", bool(mine & ISMINE_SPENDABLE));
|
||||||
|
|
||||||
bool solvable = provider && IsSolvable(*provider, scriptPubKey);
|
if (provider) {
|
||||||
ret.pushKV("solvable", solvable);
|
auto inferred = InferDescriptor(scriptPubKey, *provider);
|
||||||
|
bool solvable = inferred->IsSolvable() || IsSolvable(*provider, scriptPubKey);
|
||||||
if (solvable) {
|
ret.pushKV("solvable", solvable);
|
||||||
ret.pushKV("desc", InferDescriptor(scriptPubKey, *provider)->ToString());
|
if (solvable) {
|
||||||
|
ret.pushKV("desc", inferred->ToString());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ret.pushKV("solvable", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DescriptorScriptPubKeyMan* desc_spk_man = dynamic_cast<DescriptorScriptPubKeyMan*>(pwallet->GetScriptPubKeyMan(scriptPubKey));
|
DescriptorScriptPubKeyMan* desc_spk_man = dynamic_cast<DescriptorScriptPubKeyMan*>(pwallet->GetScriptPubKeyMan(scriptPubKey));
|
||||||
if (desc_spk_man) {
|
if (desc_spk_man) {
|
||||||
std::string desc_str;
|
std::string desc_str;
|
||||||
|
Loading…
Reference in New Issue
Block a user