Skip to content

Commit c7388e5

Browse files
committed
Report address as solvable based on inferred descriptor
1 parent 29e5dd1 commit c7388e5

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3848,13 +3848,18 @@ RPCHelpMan getaddressinfo()
38483848
isminetype mine = pwallet->IsMine(dest);
38493849
ret.pushKV("ismine", bool(mine & ISMINE_SPENDABLE));
38503850

3851-
bool solvable = provider && IsSolvable(*provider, scriptPubKey);
3852-
ret.pushKV("solvable", solvable);
3853-
3854-
if (solvable) {
3855-
ret.pushKV("desc", InferDescriptor(scriptPubKey, *provider)->ToString());
3851+
if (provider) {
3852+
auto inferred = InferDescriptor(scriptPubKey, *provider);
3853+
bool solvable = inferred->IsSolvable() || IsSolvable(*provider, scriptPubKey);
3854+
ret.pushKV("solvable", solvable);
3855+
if (solvable) {
3856+
ret.pushKV("desc", inferred->ToString());
3857+
}
3858+
} else {
3859+
ret.pushKV("solvable", false);
38563860
}
38573861

3862+
38583863
DescriptorScriptPubKeyMan* desc_spk_man = dynamic_cast<DescriptorScriptPubKeyMan*>(pwallet->GetScriptPubKeyMan(scriptPubKey));
38593864
if (desc_spk_man) {
38603865
std::string desc_str;

0 commit comments

Comments
 (0)