@@ -616,10 +616,9 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
616
616
for dest in nodes. iter( ) {
617
617
if dest. get_our_node_id( ) == node_id {
618
618
assert!( update_fee. is_none( ) ) ;
619
- let mut processed_change = false ;
620
- for update_add in update_add_htlcs {
619
+ for update_add in update_add_htlcs. iter( ) {
621
620
if !$corrupt_forward {
622
- dest. handle_update_add_htlc( & nodes[ $node] . get_our_node_id( ) , & update_add) ;
621
+ dest. handle_update_add_htlc( & nodes[ $node] . get_our_node_id( ) , update_add) ;
623
622
} else {
624
623
// Corrupt the update_add_htlc message so that its HMAC
625
624
// check will fail and we generate a
@@ -630,20 +629,18 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
630
629
let new_msg = UpdateAddHTLC :: read( & mut Cursor :: new( & msg_ser) ) . unwrap( ) ;
631
630
dest. handle_update_add_htlc( & nodes[ $node] . get_our_node_id( ) , & new_msg) ;
632
631
}
633
- processed_change = true ;
634
632
}
635
- for update_fulfill in update_fulfill_htlcs {
636
- dest. handle_update_fulfill_htlc( & nodes[ $node] . get_our_node_id( ) , & update_fulfill) ;
637
- processed_change = true ;
633
+ for update_fulfill in update_fulfill_htlcs. iter( ) {
634
+ dest. handle_update_fulfill_htlc( & nodes[ $node] . get_our_node_id( ) , update_fulfill) ;
638
635
}
639
- for update_fail in update_fail_htlcs {
640
- dest. handle_update_fail_htlc( & nodes[ $node] . get_our_node_id( ) , & update_fail) ;
641
- processed_change = true ;
636
+ for update_fail in update_fail_htlcs. iter( ) {
637
+ dest. handle_update_fail_htlc( & nodes[ $node] . get_our_node_id( ) , update_fail) ;
642
638
}
643
- for update_fail_malformed in update_fail_malformed_htlcs {
644
- dest. handle_update_fail_malformed_htlc( & nodes[ $node] . get_our_node_id( ) , & update_fail_malformed) ;
645
- processed_change = true ;
639
+ for update_fail_malformed in update_fail_malformed_htlcs. iter( ) {
640
+ dest. handle_update_fail_malformed_htlc( & nodes[ $node] . get_our_node_id( ) , update_fail_malformed) ;
646
641
}
642
+ let processed_change = !update_add_htlcs. is_empty( ) || !update_fulfill_htlcs. is_empty( ) ||
643
+ !update_fail_htlcs. is_empty( ) || !update_fail_malformed_htlcs. is_empty( ) ;
647
644
if $limit_events != ProcessMessages :: AllMessages && processed_change {
648
645
// If we only want to process some messages, don't deliver the CS until later.
649
646
extra_ev = Some ( events:: MessageSendEvent :: UpdateHTLCs { node_id, updates: CommitmentUpdate {
0 commit comments