mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
miniscript: split ValidSatisfactions from IsSane
This makes IsSane clearer. It is useful to differentiate between 'potential non-malleable satisfactions are valid' and 'such satisfactions exist' for testing. Co-authored-by: Pieter Wuille <pieter.wuille@gmail.com>
This commit is contained in:
parent
a0f064dc14
commit
5cea85f12c
1 changed files with 5 additions and 2 deletions
|
@ -779,8 +779,11 @@ public:
|
|||
//! Check whether there is no satisfaction path that contains both timelocks and heightlocks
|
||||
bool CheckTimeLocksMix() const { return GetType() << "k"_mst; }
|
||||
|
||||
//! Do all sanity checks.
|
||||
bool IsSane() const { return IsValid() && IsNonMalleable() && CheckTimeLocksMix() && CheckOpsLimit() && CheckStackSize(); }
|
||||
//! Whether successful non-malleable satisfactions are guaranteed to be valid.
|
||||
bool ValidSatisfactions() const { return IsValid() && CheckOpsLimit() && CheckStackSize(); }
|
||||
|
||||
//! Whether the apparent policy of this node matches its script semantics.
|
||||
bool IsSane() const { return ValidSatisfactions() && IsNonMalleable() && CheckTimeLocksMix(); }
|
||||
|
||||
//! Check whether this node is safe as a script on its own.
|
||||
bool IsSaneTopLevel() const { return IsValidTopLevel() && IsSane() && NeedsSignature(); }
|
||||
|
|
Loading…
Add table
Reference in a new issue