Skip to content

Commit a0f064d

Browse files
committed
miniscript: introduce a CheckTimeLocksMix helper
This helps to have finer-grained descriptor parsing errors.
1 parent ed45ee3 commit a0f064d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/script/miniscript.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,8 +776,11 @@ struct Node {
776776
//! Check whether this script always needs a signature.
777777
bool NeedsSignature() const { return GetType() << "s"_mst; }
778778

779+
//! Check whether there is no satisfaction path that contains both timelocks and heightlocks
780+
bool CheckTimeLocksMix() const { return GetType() << "k"_mst; }
781+
779782
//! Do all sanity checks.
780-
bool IsSane() const { return IsValid() && GetType() << "mk"_mst && CheckOpsLimit() && CheckStackSize(); }
783+
bool IsSane() const { return IsValid() && IsNonMalleable() && CheckTimeLocksMix() && CheckOpsLimit() && CheckStackSize(); }
781784

782785
//! Check whether this node is safe as a script on its own.
783786
bool IsSaneTopLevel() const { return IsValidTopLevel() && IsSane() && NeedsSignature(); }

0 commit comments

Comments
 (0)