Skip to content

Commit 77d7d79

Browse files
committed
Fix malleability rules according to website
We were marking extra miniscripts as non-malleable. Note that this change is previously marked non-malleable miniscripts as malleable. In particular, this affects miniscripts that are have a thresh child that does not have the `s` property. (Meaning that the thresh can be satisfied without signatures
1 parent 6a1ceac commit 77d7d79

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/miniscript/types/malleability.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,15 +317,13 @@ impl Property for Malleability {
317317
all_are_non_malleable &= subtype.non_malleable;
318318
}
319319
Ok(Malleability {
320-
dissat: if all_are_dissat_unique && (k == 1 || safe_count == n) {
320+
dissat: if all_are_dissat_unique && safe_count == n {
321321
Dissat::Unique
322322
} else {
323323
Dissat::Unknown
324324
},
325325
safe: safe_count > n - k,
326-
non_malleable: all_are_non_malleable
327-
&& safe_count >= n - k
328-
&& (k == n || all_are_dissat_unique),
326+
non_malleable: all_are_non_malleable && safe_count >= n - k && all_are_dissat_unique,
329327
})
330328
}
331329
}

0 commit comments

Comments
 (0)