Skip to content

Commit f3a50c9

Browse files
committed
miniscript: rename IsSane and IsSaneSubexpression to prevent misuse
1 parent c5fe516 commit f3a50c9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/script/miniscript.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -839,11 +839,11 @@ struct Node {
839839
//! Whether successful non-malleable satisfactions are guaranteed to be valid.
840840
bool ValidSatisfactions() const { return IsValid() && CheckOpsLimit() && CheckStackSize(); }
841841

842-
//! Whether the apparent policy of this node matches its script semantics.
843-
bool IsSane() const { return ValidSatisfactions() && IsNonMalleable() && CheckTimeLocksMix() && CheckDuplicateKey(); }
842+
//! Whether the apparent policy of this node matches its script semantics. Doesn't guarantee it is a safe script on its own.
843+
bool IsSaneSubexpression() const { return ValidSatisfactions() && IsNonMalleable() && CheckTimeLocksMix() && CheckDuplicateKey(); }
844844

845845
//! Check whether this node is safe as a script on its own.
846-
bool IsSaneTopLevel() const { return IsValidTopLevel() && IsSane() && NeedsSignature(); }
846+
bool IsSane() const { return IsValidTopLevel() && IsSaneSubexpression() && NeedsSignature(); }
847847

848848
//! Equality testing.
849849
bool operator==(const Node<Key>& arg) const { return Compare(*this, arg) == 0; }

0 commit comments

Comments
 (0)