Skip to content

Commit 85075ed

Browse files
committed
f oopsd
1 parent 0d4cea6 commit 85075ed

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

lightning/src/chain/package.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,14 @@ const LOW_FREQUENCY_BUMP_INTERVAL: u32 = 15;
113113
pub(crate) const LOW_FREQUENCY_BUMP_INTERVAL: u32 = 15;
114114

115115
/// Height delay at which transactions are fee-bumped/rebroadcasted with a middle priority.
116-
#[cfg(not(test))]
117116
const MIDDLE_FREQUENCY_BUMP_INTERVAL: u32 = 3;
118-
/// Height delay at which transactions are fee-bumped/rebroadcasted with a middle priority.
119-
#[cfg(test)]
120-
pub(crate) const MIDDLE_FREQUENCY_BUMP_INTERVAL: u32 = 3;
117+
121118
/// Height delay at which transactions are fee-bumped/rebroadcasted with a high priority.
119+
#[cfg(not(test))]
122120
const HIGH_FREQUENCY_BUMP_INTERVAL: u32 = 1;
121+
/// Height delay at which transactions are fee-bumped/rebroadcasted with a high priority.
122+
#[cfg(test)]
123+
pub(crate) const HIGH_FREQUENCY_BUMP_INTERVAL: u32 = 1;
123124

124125
/// A struct to describe a revoked output and corresponding information to generate a solving
125126
/// witness spending a commitment `to_local` output or a second-stage HTLC transaction output.
@@ -963,10 +964,10 @@ impl PackageTemplate {
963964
pub(crate) fn get_height_timer(&self, current_height: u32) -> u32 {
964965
let mut height_timer = current_height + LOW_FREQUENCY_BUMP_INTERVAL;
965966
let timer_for_target_conf = |target_conf| -> u32 {
966-
if target_conf <= current_height + LOW_FREQUENCY_BUMP_INTERVAL {
967-
current_height + MIDDLE_FREQUENCY_BUMP_INTERVAL
968-
} else if target_conf <= current_height + MIDDLE_FREQUENCY_BUMP_INTERVAL {
967+
if target_conf <= current_height + MIDDLE_FREQUENCY_BUMP_INTERVAL {
969968
current_height + HIGH_FREQUENCY_BUMP_INTERVAL
969+
} else if target_conf <= current_height + LOW_FREQUENCY_BUMP_INTERVAL {
970+
current_height + MIDDLE_FREQUENCY_BUMP_INTERVAL
970971
} else {
971972
current_height + LOW_FREQUENCY_BUMP_INTERVAL
972973
}

lightning/src/ln/functional_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::chain::chaininterface::LowerBoundedFeeEstimator;
1717
use crate::chain::channelmonitor;
1818
use crate::chain::channelmonitor::{CLOSED_CHANNEL_UPDATE_ID, CLTV_CLAIM_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS, ANTI_REORG_DELAY};
1919
use crate::chain::transaction::OutPoint;
20-
use crate::chain::package::{LOW_FREQUENCY_BUMP_INTERVAL, MIDDLE_FREQUENCY_BUMP_INTERVAL};
20+
use crate::chain::package::{LOW_FREQUENCY_BUMP_INTERVAL, HIGH_FREQUENCY_BUMP_INTERVAL};
2121
use crate::sign::{ecdsa::EcdsaChannelSigner, EntropySource, OutputSpender, SignerProvider};
2222
use crate::events::{Event, FundingInfo, MessageSendEvent, MessageSendEventsProvider, PathFailure, PaymentPurpose, ClosureReason, HTLCDestination, PaymentFailureReason};
2323
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentSecret, PaymentHash};
@@ -7550,7 +7550,7 @@ fn test_bump_penalty_txn_on_revoked_commitment() {
75507550
assert_ne!(feerate_2, 0);
75517551

75527552
// After exhaustion of height timer for a 2nd time, a new bumped justice tx should have been broadcast, check it
7553-
connect_blocks(&nodes[1], MIDDLE_FREQUENCY_BUMP_INTERVAL);
7553+
connect_blocks(&nodes[1], HIGH_FREQUENCY_BUMP_INTERVAL);
75547554
let penalty_3;
75557555
let mut feerate_3 = 0;
75567556
{

0 commit comments

Comments
 (0)