Skip to content

Commit

Permalink
Switch to other consensus lib
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasvdw committed Nov 15, 2016
1 parent 852cde2 commit 8abdc61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions bitcrust-lib/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extern {
}

#[derive(Debug)]
enum VerifyScriptError {
pub enum VerifyScriptError {
UnknownError
}

Expand All @@ -34,12 +34,12 @@ pub fn verify_script(previous_tx_out: &[u8], transaction: &[u8], input: u32) ->

let flags = 0;
let mut err: i32 = 0;
let result = unsafe { ffi::bitcoinconsensus_verify_script(
previous_tx_out.pk_script.as_ptr(),
previous_tx_out.pk_script.len() as u32,
let result = unsafe { bitcoinconsensus_verify_script(
previous_tx_out.as_ptr(),
previous_tx_out.len() as u32,
transaction.as_ptr(),
transaction.len() as u32,
index as u32,
input as u32,
flags,
&mut err
) };
Expand Down
2 changes: 1 addition & 1 deletion bitcrust-lib/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ impl<'a> Transaction<'a> {
let previous_tx_out = previous_tx.txs_out.get(input.prev_tx_out_idx as usize)
.ok_or(TransactionError::OutputIndexNotFound)?;

ffi::verify_script(previous_tx_out, self.to_raw(), index)
ffi::verify_script(previous_tx_out.pk_script, self.to_raw(), index as u32)
.expect("We can't have script errors at this stage!");


Expand Down

0 comments on commit 8abdc61

Please sign in to comment.