Skip to content

Commit

Permalink
fix: use ImpossibleSatisfaction when op_count is None
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisCho-H committed Oct 19, 2024
1 parent 0f03df0 commit 919bc4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/miniscript/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ impl ScriptContext for Legacy {
ms: &Miniscript<Pk, Self>,
) -> Result<(), ScriptContextError> {
match ms.ext.ops.op_count() {
None => Err(ScriptContextError::MaxOpCountExceeded),
None => Err(ScriptContextError::ImpossibleSatisfaction),
Some(op_count) if op_count > MAX_OPS_PER_SCRIPT => {
Err(ScriptContextError::MaxOpCountExceeded)
}
Expand Down Expand Up @@ -543,7 +543,7 @@ impl ScriptContext for Segwitv0 {
ms: &Miniscript<Pk, Self>,
) -> Result<(), ScriptContextError> {
match ms.ext.ops.op_count() {
None => Err(ScriptContextError::MaxOpCountExceeded),
None => Err(ScriptContextError::ImpossibleSatisfaction),
Some(op_count) if op_count > MAX_OPS_PER_SCRIPT => {
Err(ScriptContextError::MaxOpCountExceeded)
}
Expand Down Expand Up @@ -773,7 +773,7 @@ impl ScriptContext for BareCtx {
ms: &Miniscript<Pk, Self>,
) -> Result<(), ScriptContextError> {
match ms.ext.ops.op_count() {
None => Err(ScriptContextError::MaxOpCountExceeded),
None => Err(ScriptContextError::ImpossibleSatisfaction),
Some(op_count) if op_count > MAX_OPS_PER_SCRIPT => {
Err(ScriptContextError::MaxOpCountExceeded)
}
Expand Down

0 comments on commit 919bc4b

Please sign in to comment.