@@ -906,8 +906,8 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
906906 assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
907907 check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
908908
909- // Attempt to forward a third payment but fail due to the second channel being unavailable
910- // for forwarding .
909+ // Forward a third payment which will also be added to the holding cell, despite the channel
910+ // being paused waiting a monitor update .
911911 let ( _, payment_hash_3, payment_secret_3) = get_payment_preimage_hash ! ( nodes[ 2 ] ) ;
912912 {
913913 let net_graph_msg_handler = & nodes[ 0 ] . net_graph_msg_handler ;
@@ -922,6 +922,12 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
922922 commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 0 ] , send_event. commitment_msg, false , true ) ;
923923 check_added_monitors ! ( nodes[ 1 ] , 0 ) ;
924924
925+ // Call forward_pending_htlcs and check that the new HTLC was simply added to the holding cell
926+ // and not forwarded.
927+ expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
928+ check_added_monitors ! ( nodes[ 1 ] , 0 ) ;
929+ assert ! ( nodes[ 1 ] . node. get_and_clear_pending_events( ) . is_empty( ) ) ;
930+
925931 let ( payment_preimage_4, payment_hash_4) = if test_ignore_second_cs {
926932 // Try to route another payment backwards from 2 to make sure 1 holds off on responding
927933 let ( payment_preimage_4, payment_hash_4, payment_secret_4) = get_payment_preimage_hash ! ( nodes[ 0 ] ) ;
@@ -940,12 +946,6 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
940946 ( Some ( payment_preimage_4) , Some ( payment_hash_4) )
941947 } else { ( None , None ) } ;
942948
943- // Call forward_pending_htlcs first to make sure we don't have any issues attempting (and
944- // failing) to forward an HTLC while a channel is still awaiting monitor update restoration.
945- expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
946- check_added_monitors ! ( nodes[ 1 ] , 0 ) ;
947- assert ! ( nodes[ 1 ] . node. get_and_clear_pending_events( ) . is_empty( ) ) ;
948-
949949 // Restore monitor updating, ensuring we immediately get a fail-back update and a
950950 // update_add update.
951951 * nodes[ 1 ] . chain_monitor . update_ret . lock ( ) . unwrap ( ) = Some ( Ok ( ( ) ) ) ;
0 commit comments