From f172533212e13bae6f2d9da9f6de262ee7d4de5d Mon Sep 17 00:00:00 2001 From: Ian Slane Date: Sun, 28 Apr 2024 11:30:52 -0600 Subject: [PATCH] test --- mine-your-first-block/src/utils.rs | 2 +- mine-your-first-block/src/validation.rs | 22 ++++++++-------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/mine-your-first-block/src/utils.rs b/mine-your-first-block/src/utils.rs index 35796a5..ce293f2 100644 --- a/mine-your-first-block/src/utils.rs +++ b/mine-your-first-block/src/utils.rs @@ -77,7 +77,7 @@ pub fn serialize_block_header(block_header: &BlockHeader) -> Vec { } // Transaction serializations -/// This function will serialize a transaction into a string of hex bytes +/// This function will serialize a transaction into a hex string pub fn serialize_tx(transaction: &Transaction) -> String { // Returning the serialized tx as a string let mut serialized_tx = String::new(); diff --git a/mine-your-first-block/src/validation.rs b/mine-your-first-block/src/validation.rs index 135d876..4ab4303 100644 --- a/mine-your-first-block/src/validation.rs +++ b/mine-your-first-block/src/validation.rs @@ -67,10 +67,10 @@ pub fn process_mempool(mempool_path: &str) -> io::Result Result<(bool, S // Other smaller validations /// This function will remove dust transactions from a transaction // I will need to look more into this -pub fn is_dust_output(output: &Vout, min_fee_per_byte: u64) -> bool { - // Looked up the avg size of a P2PKH input - let input_size = 148; - // Calculate the minimum value that makes spending this output worthwhile - let min_output_value = input_size * min_fee_per_byte; - output.value < min_output_value -} +// -pub fn remove_dust_transactions(transaction: &mut Transaction, min_fee_per_byte: u64) { - transaction.vout.retain(|output| !is_dust_output(output, min_fee_per_byte)); -} +// pub fn remove_dust_transactions(transaction: &mut Transaction, min_fee_per_byte: u64) { +// transaction.vout.retain(|output| !is_dust_output(output, min_fee_per_byte)); +// } /// Function to get the tx amount so pub fn verify_tx_fee(transaction: &Transaction) -> u64 {