Skip to content

Commit 1c5cd59

Browse files
f spell out htlc_maximum_msat
1 parent 811698c commit 1c5cd59

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lightning/src/routing/router.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -968,8 +968,8 @@ fn max_htlc_from_capacity(capacity: EffectiveCapacity, max_channel_saturation_po
968968
EffectiveCapacity::Unknown => EffectiveCapacity::Unknown.as_msat(),
969969
EffectiveCapacity::AdvertisedMaxHTLC { amount_msat } =>
970970
amount_msat.checked_shr(saturation_shift).unwrap_or(0),
971-
// Treat max_htlc from a route hint as an exact liquidity amount rather than right shifting,
972-
// since the invoice is expected to have been generated from up-to-date capacity information.
971+
// Treat htlc_maximum_msat from a route hint as an exact liquidity amount, since the invoice is
972+
// expected to have been generated from up-to-date capacity information.
973973
EffectiveCapacity::HintMaxHTLC { amount_msat } => amount_msat,
974974
EffectiveCapacity::Total { capacity_msat, htlc_maximum_msat } =>
975975
cmp::min(capacity_msat.checked_shr(saturation_shift).unwrap_or(0), htlc_maximum_msat),
@@ -5916,8 +5916,8 @@ mod tests {
59165916

59175917
#[test]
59185918
fn abide_by_route_hint_max_htlc() {
5919-
// Check that we abide by any max_htlc provided in the route hints of the payment params in
5920-
// the final route.
5919+
// Check that we abide by any htlc_maximum_msat provided in the route hints of the payment
5920+
// params in the final route.
59215921
let (secp_ctx, network_graph, _, _, logger) = build_graph();
59225922
let netgraph = network_graph.read_only();
59235923
let (_, our_id, _, nodes) = get_nodes(&secp_ctx);
@@ -5944,15 +5944,15 @@ mod tests {
59445944
.with_bolt11_features(channelmanager::provided_invoice_features(&config)).unwrap();
59455945

59465946
// Make sure we'll error if our route hints don't have enough liquidity according to their
5947-
// max_htlc.
5947+
// htlc_maximum_msat.
59485948
if let Err(LightningError{err, action: ErrorAction::IgnoreError}) = get_route(&our_id,
59495949
&payment_params, &netgraph, None, max_htlc_msat + 1, Arc::clone(&logger), &scorer, &(),
59505950
&random_seed_bytes)
59515951
{
59525952
assert_eq!(err, "Failed to find a sufficient route to the given destination");
59535953
} else { panic!(); }
59545954

5955-
// Make sure we'll split an MPP payment across route hints if their max_htlcs warrant it.
5955+
// Make sure we'll split an MPP payment across route hints if their htlc_maximum_msat warrants.
59565956
let mut route_hint_2 = route_hint_1.clone();
59575957
route_hint_2.0[0].short_channel_id = 43;
59585958
let payment_params = PaymentParameters::from_node_id(dest_node_id, 42)

0 commit comments

Comments
 (0)