Skip to content

Commit

Permalink
Merge branch 'main' into mock-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-21 committed Jun 21, 2024
2 parents 0629375 + fb59134 commit 9634579
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2380,9 +2380,12 @@ impl LightningNode {
.as_msats()
.sats_round_down();
let exchange_rate = self.get_exchange_rate();

// Accomodating lightning network routing fees.
let min = limits.min + limits.min * (MAX_FEE_PERMYRIAD as u64) / 10000;
let range_hit = match balance_sat {
balance_sat if balance_sat < limits.min => RangeHit::Below {
min: limits.min.as_sats().to_amount_up(&exchange_rate),
balance_sat if balance_sat < min => RangeHit::Below {
min: min.as_sats().to_amount_up(&exchange_rate),
},
balance_sat if balance_sat <= limits.max => RangeHit::In,
balance_sat if limits.max < balance_sat => RangeHit::Above {
Expand Down

0 comments on commit 9634579

Please sign in to comment.