mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Merge bitcoin/bitcoin#25664: refactor: Redefine IsSolvable() using descriptors
b16f93caddscript/sign: remove needless IsSolvable() utility (Antoine Poinsot)c232ef20c0outputtype: remove redundant check for uncompressed keys in AddAndGetDestinationForScript (Antoine Poinsot) Pull request description: Now that we have descriptors there is no need to try to sign for a scriptPubKey using dummy signatures, and using a mocked verification of this witness against the interpreter, just to make sure we know how to spend such a Script. Just try to infer a solvable descriptor: any scriptPubKey that we can sign for can be inferred as such. This came up in #24149 but i think it's worth it on its own. ACKs for top commit: instagibbs: ACKb16f93caddachow101: re-ACKb16f93caddfurszy: ACKb16f93ca, only change is the `IsSolvable` helper function removal. Tree-SHA512: 137068157ce90210b710b1bf9ac3c400e2ff5af1112f892094b69875ea473d6a899f52adb51e5030cb907dee517602059cd1661107808558efa5de842ba12b41
This commit is contained in:
@@ -1456,7 +1456,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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user