Skip to content

Commit

Permalink
f cleanup test comments some
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed Jun 30, 2021
1 parent caf5843 commit 0534e8b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lightning/src/ln/chanmon_update_fail_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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]);
Expand All @@ -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(()));
Expand Down

0 comments on commit 0534e8b

Please sign in to comment.