Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sellout committed Feb 25, 2025
1 parent ab214e1 commit cdf9fb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,9 @@ fn is_low_der_signature(vch_sig: &ValType) -> Result<bool, ScriptError> {
// https://bitcoin.stackexchange.com/a/12556:
// Also note that inside transaction signatures, an extra hashtype byte
// follows the actual signature data.
let (_, vch_sig_copy) = vch_sig.split_last().unwrap_or_else(|| {
unreachable!("`is_valid_signature_encoding` checks that the length is at least 9.")
});
let (_, vch_sig_copy) = vch_sig
.split_last()
.expect("`is_valid_signature_encoding` checks that the length is at least 9");
// If the S value is above the order of the curve divided by two, its
// complement modulo the order could have been used instead, which is
// one byte shorter when encoded correctly.
Expand Down
1 change: 1 addition & 0 deletions src/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ impl Script<'_> {
while !pc.is_empty() {
let (opcode, new_pc) = match Self::get_op(pc) {
Ok(o) => o,
// Stop counting when we get to an invalid opcode.
Err(_) => break,
};
pc = new_pc;
Expand Down

0 comments on commit cdf9fb7

Please sign in to comment.