mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
miniscript: introduce a CheckTimeLocksMix helper
This helps to have finer-grained descriptor parsing errors.
This commit is contained in:
parent
ed45ee3882
commit
a0f064dc14
1 changed files with 4 additions and 1 deletions
|
@ -776,8 +776,11 @@ public:
|
|||
//! Check whether this script always needs a signature.
|
||||
bool NeedsSignature() const { return GetType() << "s"_mst; }
|
||||
|
||||
//! 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() && GetType() << "mk"_mst && CheckOpsLimit() && CheckStackSize(); }
|
||||
bool IsSane() const { return IsValid() && IsNonMalleable() && CheckTimeLocksMix() && CheckOpsLimit() && CheckStackSize(); }
|
||||
|
||||
//! Check whether this node is safe as a script on its own.
|
||||
bool IsSaneTopLevel() const { return IsValidTopLevel() && IsSane() && NeedsSignature(); }
|
||||
|
|
Loading…
Reference in a new issue