From: Matt Corallo Date: Tue, 17 Mar 2020 03:14:00 +0000 (-0400) Subject: Revert "Test that txn pay at least a minimum relay fee in functional tests" X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=679932e0aa5d4810a52ce1afd92c08818d7152d1;p=rust-lightning Revert "Test that txn pay at least a minimum relay fee in functional tests" This reverts commit cc038cc28796d04335f9705858cdfb74ee6f0d72. --- diff --git a/lightning/src/ln/functional_test_utils.rs b/lightning/src/ln/functional_test_utils.rs index d21dc7921..a8c4d2797 100644 --- a/lightning/src/ln/functional_test_utils.rs +++ b/lightning/src/ln/functional_test_utils.rs @@ -475,25 +475,14 @@ pub fn create_announced_chan_between_nodes_with_value<'a, 'b, 'c, 'd>(nodes: &'a macro_rules! check_spends { ($tx: expr, $($spends_txn: expr),*) => { { - let get_output = |out_point: &bitcoin::blockdata::transaction::OutPoint| { + $tx.verify(|out_point| { $( if out_point.txid == $spends_txn.txid() { return $spends_txn.output.get(out_point.vout as usize).cloned() } )* None - }; - let mut total_value_in = 0; - for input in $tx.input.iter() { - total_value_in += get_output(&input.previous_output).unwrap().value; - } - let mut total_value_out = 0; - for output in $tx.output.iter() { - total_value_out += output.value; - } - let min_fee = $tx.get_weight() as u64 / 4; // One sat per vbyte - assert!(total_value_out + min_fee <= total_value_in); // Must not be equal as there must be a fee! - $tx.verify(get_output).unwrap(); + }).unwrap(); } } }