Skip to content

Commit 1e6b54f

Browse files
committed
f go over 100 chars long to write required
1 parent 0cdc9c1 commit 1e6b54f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lightning/src/routing/scoring.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ impl<L: Deref<Target = u64>, BRT: Deref<Target = HistoricalBucketRangeTracker>,
822822
// sending less than 1/16th of a channel's capacity, or 1/8th if we used the top of the
823823
// bucket.
824824
let mut total_valid_points_tracked = 0;
825-
let reqd_decays = self.now.duration_since(*self.last_updated).as_secs()
825+
let required_decays = self.now.duration_since(*self.last_updated).as_secs()
826826
.checked_div(params.historical_no_updates_half_life.as_secs())
827827
.map_or(u32::max_value(), |decays| cmp::min(decays, u32::max_value() as u64) as u32);
828828
// Rather than actually decaying the individual buckets, which would lose precision, we
@@ -831,15 +831,15 @@ impl<L: Deref<Target = u64>, BRT: Deref<Target = HistoricalBucketRangeTracker>,
831831
// there are none, treat it as if we had no data.
832832
let mut is_fully_decayed = true;
833833
for (min_idx, min_bucket) in self.min_liquidity_offset_history.buckets.iter().enumerate() {
834-
if min_bucket.checked_shr(reqd_decays).unwrap_or(0) > 0 { is_fully_decayed = false; }
834+
if min_bucket.checked_shr(required_decays).unwrap_or(0) > 0 { is_fully_decayed = false; }
835835
for max_bucket in self.max_liquidity_offset_history.buckets.iter().take(8 - min_idx) {
836836
total_valid_points_tracked += (*min_bucket as u64) * (*max_bucket as u64);
837-
if max_bucket.checked_shr(reqd_decays).unwrap_or(0) > 0 { is_fully_decayed = false; }
837+
if max_bucket.checked_shr(required_decays).unwrap_or(0) > 0 { is_fully_decayed = false; }
838838
}
839839
}
840840
// If the total valid points is smaller than 1.0 (i.e. 32 in our fixed-point scheme),
841841
// treat it as if we were fully decayed.
842-
if total_valid_points_tracked.checked_shr(reqd_decays).unwrap_or(0) < 31*31 || is_fully_decayed {
842+
if total_valid_points_tracked.checked_shr(required_decays).unwrap_or(0) < 31*31 || is_fully_decayed {
843843
// If we don't have any valid points (or, once decayed, we have less than a full
844844
// point), redo the non-historical calculation with no liquidity bounds tracked and
845845
// the historical penalty multipliers.

0 commit comments

Comments
 (0)