Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/blockdata/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ impl Transaction {

let (one, two) = result.split_at_mut(32);
one.copy_from_slice(hash.as_inner());
one.reverse();
let output_index_bytes: [u8; 4] = (output_index as u32).to_le_bytes();
two.copy_from_slice(&output_index_bytes);
result
Expand Down
5 changes: 1 addition & 4 deletions src/blockdata/transaction/outpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ impl OutPoint {

impl From<[u8; 36]> for OutPoint {
fn from(buffer: [u8; 36]) -> Self {
let mut tx_id: [u8; 32] = buffer[0..32].try_into().unwrap();
let tx_id: [u8; 32] = buffer[0..32].try_into().unwrap();
let index: [u8; 4] = buffer[32..36].try_into().unwrap();
// Reverse the tx_id to match the endianness of Txid::from_inner
tx_id.reverse();

Self {
txid: Txid::from_inner(tx_id),
Expand Down Expand Up @@ -252,7 +250,6 @@ mod tests {
tx.add_burn_output(10000, &pk_array);

let mut expected_buf = tx.txid().as_inner().to_vec();
expected_buf.reverse();
let mut expected_index = vec![0,0,0,0];
// 0 serialized as 32 bits
expected_buf.append(&mut expected_index);
Expand Down