From e34d12fab4365e556a779df7bc977cf3c6017911 Mon Sep 17 00:00:00 2001 From: Ian Slane Date: Mon, 29 Apr 2024 08:49:48 -0600 Subject: [PATCH] testing tx_weight_fn --- mine-your-first-block/src/main.rs | 2 +- mine-your-first-block/src/utils.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mine-your-first-block/src/main.rs b/mine-your-first-block/src/main.rs index 3c47996..9834cac 100644 --- a/mine-your-first-block/src/main.rs +++ b/mine-your-first-block/src/main.rs @@ -25,7 +25,7 @@ fn main() { // My calculate_transaction_weight function is off so I increased the weight limit for a quick fix // FIX calc_tx_weight - let max_block_weight = 6000000u64; + let max_block_weight = 4000000u64; let mut total_fees = 0u64; // Sort transactions by fee in descending order before processing diff --git a/mine-your-first-block/src/utils.rs b/mine-your-first-block/src/utils.rs index 5f5d6a8..0925cf9 100644 --- a/mine-your-first-block/src/utils.rs +++ b/mine-your-first-block/src/utils.rs @@ -576,7 +576,7 @@ pub fn calculate_transaction_weight(tx: &Transaction) -> u64 { let total_size = serialized_segwit_tx(tx).len() as u64; // Calculate weight of the transaction - let tx_weight = base_size * 3 + total_size; + let tx_weight = base_size * 2 + total_size; tx_weight // Return the weight of the transaction }