Skip to content

Commit

Permalink
f fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed Oct 15, 2024
1 parent 3f6567c commit 0d4cea6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lightning/src/chain/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ const LOW_FREQUENCY_BUMP_INTERVAL: u32 = 15;
pub(crate) const LOW_FREQUENCY_BUMP_INTERVAL: u32 = 15;

/// Height delay at which transactions are fee-bumped/rebroadcasted with a middle priority.
#[cfg(not(test))]
const MIDDLE_FREQUENCY_BUMP_INTERVAL: u32 = 3;
/// Height delay at which transactions are fee-bumped/rebroadcasted with a middle priority.
#[cfg(test)]
pub(crate) const MIDDLE_FREQUENCY_BUMP_INTERVAL: u32 = 3;
/// Height delay at which transactions are fee-bumped/rebroadcasted with a high priority.
const HIGH_FREQUENCY_BUMP_INTERVAL: u32 = 1;

Expand Down
5 changes: 3 additions & 2 deletions lightning/src/ln/functional_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::chain::chaininterface::LowerBoundedFeeEstimator;
use crate::chain::channelmonitor;
use crate::chain::channelmonitor::{CLOSED_CHANNEL_UPDATE_ID, CLTV_CLAIM_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS, ANTI_REORG_DELAY};
use crate::chain::transaction::OutPoint;
use crate::chain::package::{LOW_FREQUENCY_BUMP_INTERVAL, MIDDLE_FREQUENCY_BUMP_INTERVAL};
use crate::sign::{ecdsa::EcdsaChannelSigner, EntropySource, OutputSpender, SignerProvider};
use crate::events::{Event, FundingInfo, MessageSendEvent, MessageSendEventsProvider, PathFailure, PaymentPurpose, ClosureReason, HTLCDestination, PaymentFailureReason};
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentSecret, PaymentHash};
Expand Down Expand Up @@ -7526,7 +7527,7 @@ fn test_bump_penalty_txn_on_revoked_commitment() {
};

// After exhaustion of height timer, a new bumped justice tx should have been broadcast, check it
connect_blocks(&nodes[1], 15);
connect_blocks(&nodes[1], LOW_FREQUENCY_BUMP_INTERVAL);
let mut penalty_2 = penalty_1;
let mut feerate_2 = 0;
{
Expand All @@ -7549,7 +7550,7 @@ fn test_bump_penalty_txn_on_revoked_commitment() {
assert_ne!(feerate_2, 0);

// After exhaustion of height timer for a 2nd time, a new bumped justice tx should have been broadcast, check it
connect_blocks(&nodes[1], 1);
connect_blocks(&nodes[1], MIDDLE_FREQUENCY_BUMP_INTERVAL);
let penalty_3;
let mut feerate_3 = 0;
{
Expand Down

0 comments on commit 0d4cea6

Please sign in to comment.