Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
slanesuke committed Apr 21, 2024
1 parent ce8a5de commit f0cd3e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mine-your-first-block/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct BlockHeader {
}

/// This function will return the coinbase transaction
fn create_coinbase_tx(total_tx_fee: u64, witness_root_vec: Vec<String>) -> Transaction {
fn create_coinbase_tx(total_tx_fee: u64, mut witness_root_vec: Vec<String>) -> Transaction {
let mut coinbase_tx = Transaction {
version: 0,
locktime: 0,
Expand Down Expand Up @@ -142,7 +142,7 @@ fn create_coinbase_tx(total_tx_fee: u64, witness_root_vec: Vec<String>) -> Trans
// the witness root hash gets hashed with the witness reserve value and put into
// the scriptpubkey of the second output
// Made some edits to work directly with bytes so i didnt have to decode and encode

witness_root_vec.insert(0, witness_reserved_value.to_string());

let witness_root_hash = get_merkle_root(witness_root_vec);
let mut witness_root_hash_bytes = hex::decode(witness_root_hash).unwrap();
Expand Down

0 comments on commit f0cd3e7

Please sign in to comment.