Skip to content

Commit 3f6567c

Browse files
committed
Correct RBF bump rate calculation
Dating back to its introduction in 757bcc2, `get_height_timer` has never used the `MIDDLE_FREQUENCY_BUMP_INTERVAL` (then not even a constant) as its if tree was in the wrong order. This fixes that.
1 parent 71e6506 commit 3f6567c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lightning/src/chain/package.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -959,10 +959,10 @@ impl PackageTemplate {
959959
pub(crate) fn get_height_timer(&self, current_height: u32) -> u32 {
960960
let mut height_timer = current_height + LOW_FREQUENCY_BUMP_INTERVAL;
961961
let timer_for_target_conf = |target_conf| -> u32 {
962-
if target_conf <= current_height + MIDDLE_FREQUENCY_BUMP_INTERVAL {
963-
current_height + HIGH_FREQUENCY_BUMP_INTERVAL
964-
} else if target_conf <= current_height + LOW_FREQUENCY_BUMP_INTERVAL {
962+
if target_conf <= current_height + LOW_FREQUENCY_BUMP_INTERVAL {
965963
current_height + MIDDLE_FREQUENCY_BUMP_INTERVAL
964+
} else if target_conf <= current_height + MIDDLE_FREQUENCY_BUMP_INTERVAL {
965+
current_height + HIGH_FREQUENCY_BUMP_INTERVAL
966966
} else {
967967
current_height + LOW_FREQUENCY_BUMP_INTERVAL
968968
}

0 commit comments

Comments
 (0)