Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
slanesuke committed Apr 22, 2024
1 parent 1cd146c commit 3154df3
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 @@ -1360,14 +1360,16 @@ fn main() {

// Generate coinbase tx
let coinbase_tx = create_coinbase_tx(total_fees, wtx_ids_for_witness_root.clone());
// let serialized_cb_tx = serialize_tx(&coinbase_tx);
let serialized_cb_tx = serialized_segwit_tx(&coinbase_tx);
println!("Coinbase tx: {}", serialized_cb_tx);
let cd_tx_bytes = hex::decode(serialized_cb_tx.clone()).unwrap();
// coinbase txid
println!("Coinbase tx befoore hash: {}", hex::encode(cd_tx_bytes.clone()));
let coinbase_txid = double_sha256(cd_tx_bytes.clone());
let mut coinbase_txid_le = coinbase_txid.to_vec();
coinbase_txid_le.reverse();
let coinbase_txid = hex::encode(coinbase_txid_le);
println!("Coinbase txid: {}", coinbase_txid);

// Insert the coinbase transaction at the beginning of block_txs
let coinbase_tx_for_processing = TransactionForProcessing {
Expand Down

0 comments on commit 3154df3

Please sign in to comment.