Skip to content

Commit

Permalink
f comment why its an f64
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed Dec 19, 2024
1 parent 8fbbe8f commit 7c8fa41
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lightning/src/routing/scoring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1817,6 +1817,11 @@ mod bucketed_history {
// Because the first thing we do is check if `total_valid_points` is sufficient to consider
// the data here at all, and can return early if it is not, we want this to go first to
// avoid hitting a second cache line load entirely in that case.
//
// Note that we store it as an `f64` rather than a `u64` (potentially losing some
// precision) because we ultimately need the value as an `f64` when dividing bucket weights
// by it. Storing it as an `f64` avoids doing the additional int -> float conversion in the
// hot score-calculation path.
total_valid_points_tracked: f64,
min_liquidity_offset_history: HistoricalBucketRangeTracker,
max_liquidity_offset_history: HistoricalBucketRangeTracker,
Expand Down

0 comments on commit 7c8fa41

Please sign in to comment.