diff --git a/src/blockdata/script.rs b/src/blockdata/script.rs index 00aaa4e..65231d4 100644 --- a/src/blockdata/script.rs +++ b/src/blockdata/script.rs @@ -643,6 +643,7 @@ impl Script { let mut remove = Script::new(); remove.push_slice(sig_slice); script_find_and_remove(&mut script, remove.as_slice()); + script_find_and_remove(&mut script, [opcodes::OP_CODESEPARATOR as u8]); // This is as far as we can go without a transaction, so fail here if input_context.is_none() { return Err(NoTransaction); } @@ -692,6 +693,7 @@ impl Script { let mut remove = Script::new(); remove.push_slice(sig.as_slice()); script_find_and_remove(&mut script, remove.as_slice()); + script_find_and_remove(&mut script, [opcodes::OP_CODESEPARATOR as u8]); } // This is as far as we can go without a transaction, so fail here @@ -781,6 +783,27 @@ mod test { use blockdata::transaction::Transaction; use util::thinvec::ThinVec; + fn test_tx(tx_hex: &'static str, output_hex: Vec<&'static str>) { + let tx_hex = tx_hex.from_hex().unwrap(); + + let tx: Transaction = deserialize(tx_hex.clone()).ok().expect("transaction"); + let script_pk: Vec