Skip to content

Commit 907c100

Browse files
committed
cleanup the first non-dust htlc
1 parent bf8aa1f commit 907c100

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lightning/src/ln/functional_tests.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10687,8 +10687,19 @@ fn do_test_nondust_htlc_fees_dust_exposure_delta(features: ChannelTypeFeatures)
1068710687
nodes[1].logger.assert_log("lightning::ln::channel",
1068810688
format!("Cannot accept value that would put our exposure to tx fee dust at {} over the limit {} on counterparty commitment tx",
1068910689
expected_dust_exposure_msat, threshold_dust_exposure_msat), 1);
10690-
let _ = nodes[1].node.get_and_clear_pending_msg_events();
10690+
check_added_monitors!(nodes[1], 1);
10691+
10692+
let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
10693+
assert!(updates.update_add_htlcs.is_empty());
10694+
assert!(updates.update_fulfill_htlcs.is_empty());
10695+
assert_eq!(updates.update_fail_htlcs.len(), 1);
10696+
assert!(updates.update_fail_malformed_htlcs.is_empty());
10697+
assert!(updates.update_fee.is_none());
10698+
nodes[0].node.handle_update_fail_htlc(nodes[1].node.get_our_node_id(), &updates.update_fail_htlcs[0]);
10699+
commitment_signed_dance!(nodes[0], nodes[1], updates.commitment_signed, false);
10700+
expect_payment_failed!(nodes[0], payment_hash, false);
1069110701

10702+
// Send an additional non-dust htlc the other way using the pre-calculated route above, and check for an immediate complaint from `FundedChannel`
1069210703
unwrap_send_err!(nodes[1], nodes[1].node.send_payment_with_route(route_1_0, payment_hash_1_0,
1069310704
RecipientOnionFields::secret_only(payment_secret_1_0), PaymentId(payment_hash_1_0.0)
1069410705
), true, APIError::ChannelUnavailable { .. }, {});

0 commit comments

Comments
 (0)