Skip to content

Commit

Permalink
Fixed borrow bug
Browse files Browse the repository at this point in the history
  • Loading branch information
slanesuke committed Apr 12, 2024
1 parent 013cce8 commit 1ffdd15
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mine-your-first-block/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,7 @@ fn main() {
// Get the block header and serialize it
let block_header = construct_block_header(valid_txids.clone(), nonce);
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());
let hashed_block_header = double_sha256(serialized_block_header.clone().as_bytes().to_vec());

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

0 comments on commit 1ffdd15

Please sign in to comment.