Skip to content

Commit

Permalink
cleanup the first non-dust htlc
Browse files Browse the repository at this point in the history
  • Loading branch information
tankyleo committed Feb 6, 2025
1 parent bf8aa1f commit 907c100
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lightning/src/ln/functional_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10687,8 +10687,19 @@ fn do_test_nondust_htlc_fees_dust_exposure_delta(features: ChannelTypeFeatures)
nodes[1].logger.assert_log("lightning::ln::channel",
format!("Cannot accept value that would put our exposure to tx fee dust at {} over the limit {} on counterparty commitment tx",
expected_dust_exposure_msat, threshold_dust_exposure_msat), 1);
let _ = nodes[1].node.get_and_clear_pending_msg_events();
check_added_monitors!(nodes[1], 1);

let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
assert!(updates.update_add_htlcs.is_empty());
assert!(updates.update_fulfill_htlcs.is_empty());
assert_eq!(updates.update_fail_htlcs.len(), 1);
assert!(updates.update_fail_malformed_htlcs.is_empty());
assert!(updates.update_fee.is_none());
nodes[0].node.handle_update_fail_htlc(nodes[1].node.get_our_node_id(), &updates.update_fail_htlcs[0]);
commitment_signed_dance!(nodes[0], nodes[1], updates.commitment_signed, false);
expect_payment_failed!(nodes[0], payment_hash, false);

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

0 comments on commit 907c100

Please sign in to comment.