Skip to content

Commit cfaa175

Browse files
committed
f readability improvements from Val
1 parent c9e78f0 commit cfaa175

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lightning/src/ln/functional_tests.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3623,7 +3623,7 @@ fn test_drop_messages_peer_disconnect_dual_htlc() {
36233623
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_2, 1_000_000);
36243624
}
36253625

3626-
fn do_test_htlc_timeout(subpath: bool) {
3626+
fn do_test_htlc_timeout(send_partial_mpp: bool) {
36273627
// If the user fails to claim/fail an HTLC within the HTLC CLTV timeout we fail it for them
36283628
// to avoid our counterparty failing the channel.
36293629
let chanmon_cfgs = create_chanmon_cfgs(2);
@@ -3633,14 +3633,18 @@ fn do_test_htlc_timeout(subpath: bool) {
36333633

36343634
create_announced_chan_between_nodes(&nodes, 0, 1, InitFeatures::supported(), InitFeatures::supported());
36353635

3636-
let our_payment_hash = if subpath {
3636+
let our_payment_hash = if send_partial_mpp {
36373637
let route = nodes[0].router.get_route(&nodes[1].node.get_our_node_id(), None, &Vec::new(), 100000, TEST_FINAL_CLTV).unwrap();
36383638
let (_, our_payment_hash) = get_payment_preimage_hash!(&nodes[0]);
36393639
let payment_secret = PaymentSecret([0xdb; 32]);
3640+
// Use the utility function send_payment_along_path to send the payment with MPP data which
3641+
// indicates there are more HTLCs coming.
36403642
nodes[0].node.send_payment_along_path(&route.paths[0], &our_payment_hash, &Some(payment_secret), 200000, CHAN_CONFIRM_DEPTH).unwrap();
36413643
check_added_monitors!(nodes[0], 1);
36423644
let mut events = nodes[0].node.get_and_clear_pending_msg_events();
36433645
assert_eq!(events.len(), 1);
3646+
// Now do the relevant commitment_signed/RAA dances along the path, noting that the final
3647+
// hop should *not* yet generate any PaymentReceived event(s).
36443648
pass_along_path(&nodes[0], &[&nodes[1]], 100000, our_payment_hash, Some(payment_secret), events.drain(..).next().unwrap(), false);
36453649
our_payment_hash
36463650
} else {

0 commit comments

Comments
 (0)