Skip to content

Commit e81ec4a

Browse files
committed
Check all outputs meet the dust threshold in check_spends!()
1 parent 9c1c7c4 commit e81ec4a

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
@@ -690,6 +690,14 @@ pub fn update_nodes_with_chan_announce<'a, 'b, 'c, 'd>(nodes: &'a Vec<Node<'b, '
690690
macro_rules! check_spends {
691691
($tx: expr, $($spends_txn: expr),*) => {
692692
{
693+
$(
694+
for outp in $spends_txn.output.iter() {
695+
assert!(outp.value >= outp.script_pubkey.dust_value().as_sat(), "Input tx output didn't meet dust limit");
696+
}
697+
)*
698+
for outp in $tx.output.iter() {
699+
assert!(outp.value >= outp.script_pubkey.dust_value().as_sat(), "Spending tx output didn't meet dust limit");
700+
}
693701
let get_output = |out_point: &bitcoin::blockdata::transaction::OutPoint| {
694702
$(
695703
if out_point.txid == $spends_txn.txid() {

0 commit comments

Comments
 (0)