Skip to content

Commit

Permalink
Correct RBF bump rate calculation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TheBlueMatt committed Oct 8, 2024
1 parent 8f93459 commit 8e2419c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lightning/src/chain/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -959,10 +959,10 @@ impl PackageTemplate {
pub(crate) fn get_height_timer(&self, current_height: u32) -> u32 {
let mut height_timer = current_height + LOW_FREQUENCY_BUMP_INTERVAL;
let timer_for_target_conf = |target_conf| -> u32 {
if target_conf <= current_height + MIDDLE_FREQUENCY_BUMP_INTERVAL {
current_height + HIGH_FREQUENCY_BUMP_INTERVAL
} else if target_conf <= current_height + LOW_FREQUENCY_BUMP_INTERVAL {
if target_conf <= current_height + LOW_FREQUENCY_BUMP_INTERVAL {
current_height + MIDDLE_FREQUENCY_BUMP_INTERVAL
} else if target_conf <= current_height + MIDDLE_FREQUENCY_BUMP_INTERVAL {
current_height + HIGH_FREQUENCY_BUMP_INTERVAL
} else {
current_height + LOW_FREQUENCY_BUMP_INTERVAL
}
Expand Down

0 comments on commit 8e2419c

Please sign in to comment.