Merge pull request #1027 from TheBlueMatt/2021-07-check-dust
[rust-lightning] / lightning / src / ln / functional_test_utils.rs
index e9e36e607ec45950dc4ebadab6a8c940c756f114..9b435516b4aea51b47b62a24801f950176dc3edc 100644 (file)
@@ -707,6 +707,14 @@ pub fn update_nodes_with_chan_announce<'a, 'b, 'c, 'd>(nodes: &'a Vec<Node<'b, '
 macro_rules! check_spends {
        ($tx: expr, $($spends_txn: expr),*) => {
                {
+                       $(
+                       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() {