@@ -822,7 +822,7 @@ impl<L: Deref<Target = u64>, BRT: Deref<Target = HistoricalBucketRangeTracker>,
822
822
// sending less than 1/16th of a channel's capacity, or 1/8th if we used the top of the
823
823
// bucket.
824
824
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 ( )
826
826
. checked_div ( params. historical_no_updates_half_life . as_secs ( ) )
827
827
. map_or ( u32:: max_value ( ) , |decays| cmp:: min ( decays, u32:: max_value ( ) as u64 ) as u32 ) ;
828
828
// 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>,
831
831
// there are none, treat it as if we had no data.
832
832
let mut is_fully_decayed = true ;
833
833
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 ; }
835
835
for max_bucket in self . max_liquidity_offset_history . buckets . iter ( ) . take ( 8 - min_idx) {
836
836
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 ; }
838
838
}
839
839
}
840
840
// If the total valid points is smaller than 1.0 (i.e. 32 in our fixed-point scheme),
841
841
// 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 {
843
843
// If we don't have any valid points (or, once decayed, we have less than a full
844
844
// point), redo the non-historical calculation with no liquidity bounds tracked and
845
845
// the historical penalty multipliers.
0 commit comments