Skip to content

Commit

Permalink
f til about clamp
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed Jan 12, 2025
1 parent 60801d9 commit 8b5cd47
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lightning/src/ln/onion_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,10 @@ pub(crate) fn set_max_path_length(
.saturating_add(PAYLOAD_HMAC_LEN);

const OVERPAY_ESTIMATE_MULTIPLER: u64 = 3;
let final_value_msat_with_overpay_buffer = core::cmp::min(
0x1000_0000,
core::cmp::max(
route_params.final_value_msat.saturating_mul(OVERPAY_ESTIMATE_MULTIPLER),
MIN_FINAL_VALUE_ESTIMATE_WITH_OVERPAY,
),
);
let final_value_msat_with_overpay_buffer = route_params
.final_value_msat
.saturating_mul(OVERPAY_ESTIMATE_MULTIPLER)
.clamp(MIN_FINAL_VALUE_ESTIMATE_WITH_OVERPAY, 0x1000_0000);

let blinded_tail_opt = route_params
.payment_params
Expand Down

0 comments on commit 8b5cd47

Please sign in to comment.