Skip to content

Commit

Permalink
adding half tx
Browse files Browse the repository at this point in the history
  • Loading branch information
slanesuke committed Apr 16, 2024
1 parent c0292a9 commit 0a6b634
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mine-your-first-block/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -964,9 +964,11 @@ fn main() {
append_to_file("../output.txt", &hex::encode(serialized_block_header)).unwrap();
append_to_file("../output.txt", &serialized_cb_tx).unwrap();

// to test block weight
let half_txid = sorted_txids.len() /2;

// Add the txids to the block
for txid in &sorted_txids {
for txid in &sorted_txids[0..half_txid] {
append_to_file("../output.txt", txid).unwrap();
}
println!("Success, the block met the target difficulty!");
Expand Down

0 comments on commit 0a6b634

Please sign in to comment.