From b5ad9b2ac0b179dced564931c1b8e61a5e074df9 Mon Sep 17 00:00:00 2001 From: Ian Slane Date: Sat, 20 Apr 2024 12:43:29 -0600 Subject: [PATCH] testing witness root calc --- mine-your-first-block/src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mine-your-first-block/src/main.rs b/mine-your-first-block/src/main.rs index ccb46da..78a0137 100644 --- a/mine-your-first-block/src/main.rs +++ b/mine-your-first-block/src/main.rs @@ -155,6 +155,7 @@ fn create_coinbase_tx(total_tx_fee: u64, witness_root: String) -> Transaction { // scriptpubkey_address: None, // value: 0, // }); + // Made some edits to work directly with bytes so i didnt have to decode and encode let op_return_prefix = vec![0x6a, 0x24, 0xaa, 0x21, 0xa9, 0xed]; let witness_root_bytes = hex::decode(witness_root).unwrap(); let witness_reserved_value_bytes = hex::decode(witness_reserved_value).unwrap(); @@ -1406,7 +1407,8 @@ fn main() { } // Get the wtxids for the witness root - let mut wtx_ids_for_witness_root = vec!["0000000000000000000000000000000000000000000000000000000000000000".to_string()]; + // let mut wtx_ids_for_witness_root = vec!["0000000000000000000000000000000000000000000000000000000000000000".to_string()]; + let mut wtx_ids_for_witness_root = vec![]; for tx in &block_txs { if tx.is_p2wpkh { if let Some(ref wtxid) = tx.wtxid {