From b8514cb52c9da3493b0bde4a356ed00ff6fb7b8b Mon Sep 17 00:00:00 2001 From: Ian Slane Date: Mon, 29 Apr 2024 11:51:32 -0600 Subject: [PATCH] commit before fetch upstream --- mine-your-first-block/src/main.rs | 3 --- mine-your-first-block/src/validation.rs | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mine-your-first-block/src/main.rs b/mine-your-first-block/src/main.rs index 9834cac..a571bd7 100644 --- a/mine-your-first-block/src/main.rs +++ b/mine-your-first-block/src/main.rs @@ -22,9 +22,6 @@ fn main() { // Initializing block weight let mut block_txs: Vec = Vec::new(); let mut total_weight = 0u64; - - // 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 = 4000000u64; let mut total_fees = 0u64; diff --git a/mine-your-first-block/src/validation.rs b/mine-your-first-block/src/validation.rs index 1415d87..0402a32 100644 --- a/mine-your-first-block/src/validation.rs +++ b/mine-your-first-block/src/validation.rs @@ -1,4 +1,4 @@ -use crate::transactions::{Transaction, Vout, TransactionForProcessing}; +use crate::transactions::{Transaction, TransactionForProcessing}; use std::io; use std::time::{SystemTime, UNIX_EPOCH}; extern crate secp256k1; @@ -389,6 +389,7 @@ pub fn p2pkh_script_validation(transaction: &mut Transaction) -> Result<(bool, S } +// Helper functions to weed out bad transactions. /// Function to get the tx amount so pub fn verify_tx_fee(transaction: &Transaction) -> u64 { let total_input_amount: u64 = transaction.vin.iter()