diff options
author | Antoine Poinsot <darosior@protonmail.com> | 2022-07-20 12:42:08 +0200 |
---|---|---|
committer | Antoine Poinsot <darosior@protonmail.com> | 2022-08-11 15:43:40 +0200 |
commit | b16f93caddcd3254eaf3dc43e09adf2142a9c40a (patch) | |
tree | 675b615337627dead3cde665e3bb3e951e54565f /src/wallet | |
parent | c232ef20c0fd2e3b55355e52684091cad3af5247 (diff) | |
download | bitcoin-b16f93caddcd3254eaf3dc43e09adf2142a9c40a.tar.xz |
script/sign: remove needless IsSolvable() utility
It was used back when we didn't have a concept of descriptor. Now we
can check for solvability using descriptors.
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/rpc/addresses.cpp | 2 | ||||
-rw-r--r-- | src/wallet/scriptpubkeyman.cpp | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/wallet/rpc/addresses.cpp b/src/wallet/rpc/addresses.cpp index 148343a8b0..903a569cb9 100644 --- a/src/wallet/rpc/addresses.cpp +++ b/src/wallet/rpc/addresses.cpp @@ -578,7 +578,7 @@ RPCHelpMan getaddressinfo() if (provider) { auto inferred = InferDescriptor(scriptPubKey, *provider); - bool solvable = inferred->IsSolvable() || IsSolvable(*provider, scriptPubKey); + bool solvable = inferred->IsSolvable(); ret.pushKV("solvable", solvable); if (solvable) { ret.pushKV("desc", inferred->ToString()); diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index 1682ce2eef..b498ad5a17 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -1453,7 +1453,8 @@ void LegacyScriptPubKeyMan::LearnRelatedScripts(const CPubKey& key, OutputType t CTxDestination witdest = WitnessV0KeyHash(key.GetID()); CScript witprog = GetScriptForDestination(witdest); // Make sure the resulting program is solvable. - assert(IsSolvable(*this, witprog)); + const auto desc = InferDescriptor(witprog, *this); + assert(desc && desc->IsSolvable()); AddCScript(witprog); } } |