@@ -1494,9 +1494,28 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1494
1494
assert ! (
1495
1495
send_payment( & nodes[ 0 ] , & nodes[ 1 ] , chan_a, 10_000_000 , & mut payment_id, & mut payment_idx) ||
1496
1496
send_payment( & nodes[ 1 ] , & nodes[ 0 ] , chan_a, 10_000_000 , & mut payment_id, & mut payment_idx) ) ;
1497
+ out. locked_write ( format ! ( "Successfully sent a payment between node 0 and node 1.\n " ) . as_bytes ( ) ) ;
1498
+
1497
1499
assert ! (
1498
1500
send_payment( & nodes[ 1 ] , & nodes[ 2 ] , chan_b, 10_000_000 , & mut payment_id, & mut payment_idx) ||
1499
1501
send_payment( & nodes[ 2 ] , & nodes[ 1 ] , chan_b, 10_000_000 , & mut payment_id, & mut payment_idx) ) ;
1502
+ out. locked_write ( format ! ( "Successfully sent a payment between node 1 and node 2.\n " ) . as_bytes ( ) ) ;
1503
+
1504
+ out. locked_write ( format ! ( "Flushing pending messages.\n " ) . as_bytes ( ) ) ;
1505
+ for i in 0 ..std:: usize:: MAX {
1506
+ if i == 100 { panic ! ( "It may take may iterations to settle the state, but it should not take forever" ) ; }
1507
+
1508
+ // Then, make sure any current forwards make their way to their destination
1509
+ if process_msg_events ! ( 0 , false , ProcessMessages :: AllMessages ) { continue ; }
1510
+ if process_msg_events ! ( 1 , false , ProcessMessages :: AllMessages ) { continue ; }
1511
+ if process_msg_events ! ( 2 , false , ProcessMessages :: AllMessages ) { continue ; }
1512
+ // ...making sure any pending PendingHTLCsForwardable events are handled and
1513
+ // payments claimed.
1514
+ if process_events ! ( 0 , false ) { continue ; }
1515
+ if process_events ! ( 1 , false ) { continue ; }
1516
+ if process_events ! ( 2 , false ) { continue ; }
1517
+ break ;
1518
+ }
1500
1519
1501
1520
last_htlc_clear_fee_a = fee_est_a. ret_val . load ( atomic:: Ordering :: Acquire ) ;
1502
1521
last_htlc_clear_fee_b = fee_est_b. ret_val . load ( atomic:: Ordering :: Acquire ) ;
0 commit comments