Skip to content

Commit e4a1ad8

Browse files
committed
Check all outputs meet the dust threshold in check_spends!()
1 parent 0671ca6 commit e4a1ad8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lightning/src/ln/functional_test_utils.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,14 @@ pub fn update_nodes_with_chan_announce<'a, 'b, 'c, 'd>(nodes: &'a Vec<Node<'b, '
678678
macro_rules! check_spends {
679679
($tx: expr, $($spends_txn: expr),*) => {
680680
{
681+
$(
682+
for outp in $spends_txn.output.iter() {
683+
assert!(outp.value >= outp.script_pubkey.dust_value().as_sat(), "Input tx output didn't meet dust limit");
684+
}
685+
)*
686+
for outp in $tx.output.iter() {
687+
assert!(outp.value >= outp.script_pubkey.dust_value().as_sat(), "Spending tx output didn't meet dust limit");
688+
}
681689
let get_output = |out_point: &bitcoin::blockdata::transaction::OutPoint| {
682690
$(
683691
if out_point.txid == $spends_txn.txid() {

0 commit comments

Comments
 (0)