Skip to content

Commit

Permalink
testing witness root calc
Browse files Browse the repository at this point in the history
  • Loading branch information
slanesuke committed Apr 20, 2024
1 parent d9eab45 commit b5ad9b2
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 @@ -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();
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit b5ad9b2

Please sign in to comment.