From: Matt Corallo Date: Sat, 31 Jul 2021 18:33:57 +0000 (+0000) Subject: Check all outputs meet the dust threshold in check_spends!() X-Git-Tag: v0.0.104~31^2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=refs%2Fheads%2F2021-07-check-dust;p=rust-lightning Check all outputs meet the dust threshold in check_spends!() --- diff --git a/lightning/src/ln/functional_test_utils.rs b/lightning/src/ln/functional_test_utils.rs index 82c5d2901..6b46f6281 100644 --- a/lightning/src/ln/functional_test_utils.rs +++ b/lightning/src/ln/functional_test_utils.rs @@ -690,6 +690,14 @@ pub fn update_nodes_with_chan_announce<'a, 'b, 'c, 'd>(nodes: &'a Vec { { + $( + for outp in $spends_txn.output.iter() { + assert!(outp.value >= outp.script_pubkey.dust_value().as_sat(), "Input tx output didn't meet dust limit"); + } + )* + for outp in $tx.output.iter() { + assert!(outp.value >= outp.script_pubkey.dust_value().as_sat(), "Spending tx output didn't meet dust limit"); + } let get_output = |out_point: &bitcoin::blockdata::transaction::OutPoint| { $( if out_point.txid == $spends_txn.txid() {