From 0534e8b9edd31bb05e376d3e54bb329f14174684 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 30 Jun 2021 19:35:01 +0000 Subject: [PATCH] f cleanup test comments some --- lightning/src/ln/chanmon_update_fail_tests.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lightning/src/ln/chanmon_update_fail_tests.rs b/lightning/src/ln/chanmon_update_fail_tests.rs index 26ca9a4056b..73fc531562b 100644 --- a/lightning/src/ln/chanmon_update_fail_tests.rs +++ b/lightning/src/ln/chanmon_update_fail_tests.rs @@ -906,8 +906,8 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) { assert!(nodes[1].node.get_and_clear_pending_msg_events().is_empty()); check_added_monitors!(nodes[1], 1); - // Attempt to forward a third payment but fail due to the second channel being unavailable - // for forwarding. + // Forward a third payment which will also be added to the holding cell, despite the channel + // being paused waiting a monitor update. let (_, payment_hash_3, payment_secret_3) = get_payment_preimage_hash!(nodes[2]); { 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) { commitment_signed_dance!(nodes[1], nodes[0], send_event.commitment_msg, false, true); check_added_monitors!(nodes[1], 0); + // Call forward_pending_htlcs and check that the new HTLC was simply added to the holding cell + // and not forwarded. + expect_pending_htlcs_forwardable!(nodes[1]); + check_added_monitors!(nodes[1], 0); + assert!(nodes[1].node.get_and_clear_pending_events().is_empty()); + let (payment_preimage_4, payment_hash_4) = if test_ignore_second_cs { // Try to route another payment backwards from 2 to make sure 1 holds off on responding 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) { (Some(payment_preimage_4), Some(payment_hash_4)) } else { (None, None) }; - // Call forward_pending_htlcs first to make sure we don't have any issues attempting (and - // failing) to forward an HTLC while a channel is still awaiting monitor update restoration. - expect_pending_htlcs_forwardable!(nodes[1]); - check_added_monitors!(nodes[1], 0); - assert!(nodes[1].node.get_and_clear_pending_events().is_empty()); - // Restore monitor updating, ensuring we immediately get a fail-back update and a // update_add update. *nodes[1].chain_monitor.update_ret.lock().unwrap() = Some(Ok(()));