Skip to content

Commit 9a855be

Browse files
committed
f - divide by a power of 2
1 parent c2572a1 commit 9a855be

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lightning/src/routing/scoring.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1165,8 +1165,9 @@ impl<L: Deref<Target = u64>, BRT: Deref<Target = HistoricalBucketRangeTracker>,
11651165
if half_decays % 2 == 0 {
11661166
decayed_offset_msat
11671167
} else {
1168-
// 71 / 100 ~= core::f64::consts::FRAC_1_SQRT_2
1169-
(decayed_offset_msat as u128 * 71 / 100) as u64
1168+
// 11_585 / 16_384 ~= core::f64::consts::FRAC_1_SQRT_2
1169+
// 16_384 == 2^14
1170+
(decayed_offset_msat as u128 * 11_585 / 16_384) as u64
11701171
}
11711172
}
11721173
}

0 commit comments

Comments
 (0)