We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a89bd0 commit 00d4832Copy full SHA for 00d4832
src/util.rs
@@ -52,11 +52,14 @@ impl MsKeyBuilder for script::Builder {
52
// This belongs in rust-bitcoin, make this upstream later
53
pub(crate) fn script_is_v1_tr(s: &Script) -> bool {
54
let mut iter = s.instructions_minimal();
55
- if s.len() != 32
56
- || iter.next() != Some(Ok(Instruction::Op(opcodes::all::OP_PUSHNUM_1)))
57
- || iter.next() != Some(Ok(Instruction::Op(opcodes::all::OP_PUSHBYTES_32)))
58
- {
+ if s.len() != 34 {
+ return false;
+ }
+ if iter.next() != Some(Ok(Instruction::Op(opcodes::all::OP_PUSHNUM_1))) {
59
return false;
60
}
61
- return true;
+ if let Some(Ok(Instruction::PushBytes(p))) = iter.next() {
62
+ return p.len() == 32;
63
64
65
0 commit comments