Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
slanesuke committed Apr 16, 2024
1 parent a38a6db commit 460c733
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mine-your-first-block/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,10 @@ fn get_merkle_root(txids: Vec<String>) -> String {
}).collect()
}
// The last hash in the merkle tree
// merkle root
hex::encode(be_txid[0])

// merkle root in little endian
let merkle_root = be_txid[0].to_vec();
let merkle_root_be = merkle_root.iter().rev().cloned().collect::<Vec<u8>>();
hex::encode(merkle_root_be)
}

fn deserialize_tx(filename: &str) -> Transaction {
Expand Down

0 comments on commit 460c733

Please sign in to comment.