Skip to content

Commit

Permalink
Fixxed error in block header hash to be lil endian
Browse files Browse the repository at this point in the history
  • Loading branch information
slanesuke committed Apr 12, 2024
1 parent 2d19a02 commit 013cce8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mine-your-first-block/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,9 @@ fn main() {
let serialized_block_header = serialize_block_header(&block_header);
let block_header = serialized_block_header.clone().as_bytes();
let hashed_block_header = double_sha256(block_header.to_vec());

// Reverse byte order
let hashed_block_header: Vec<u8> = hashed_block_header.iter().rev().cloned().collect();
let hash_header = hex::encode(hashed_block_header);


Expand Down

0 comments on commit 013cce8

Please sign in to comment.