Skip to content

Commit 93cd12f

Browse files
committed
Move IDEMPOTENCY_TIMEOUT_TICKS to where it is used
1 parent be1f8be commit 93cd12f

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,11 +1341,6 @@ const CHECK_CLTV_EXPIRY_SANITY_2: u32 = MIN_CLTV_EXPIRY_DELTA as u32 - LATENCY_G
13411341
/// The number of ticks of [`ChannelManager::timer_tick_occurred`] until expiry of incomplete MPPs
13421342
pub(crate) const MPP_TIMEOUT_TICKS: u8 = 3;
13431343

1344-
/// The number of ticks of [`ChannelManager::timer_tick_occurred`] until we time-out the
1345-
/// idempotency of payments by [`PaymentId`]. See
1346-
/// [`OutboundPayments::remove_stale_payments`].
1347-
pub(crate) const IDEMPOTENCY_TIMEOUT_TICKS: u8 = 7;
1348-
13491344
/// The number of ticks of [`ChannelManager::timer_tick_occurred`] where a peer is disconnected
13501345
/// until we mark the channel disabled and gossip the update.
13511346
pub(crate) const DISABLE_GOSSIP_TICKS: u8 = 10;

lightning/src/ln/outbound_payment.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use bitcoin::secp256k1::{self, Secp256k1, SecretKey};
1616
use crate::sign::{EntropySource, NodeSigner, Recipient};
1717
use crate::events::{self, PaymentFailureReason};
1818
use crate::ln::{PaymentHash, PaymentPreimage, PaymentSecret};
19-
use crate::ln::channelmanager::{ChannelDetails, EventCompletionAction, HTLCSource, IDEMPOTENCY_TIMEOUT_TICKS, PaymentId};
19+
use crate::ln::channelmanager::{ChannelDetails, EventCompletionAction, HTLCSource, PaymentId};
2020
use crate::ln::onion_utils::{DecodedOnionFailure, HTLCFailReason};
2121
use crate::routing::router::{InFlightHtlcs, Path, PaymentParameters, Route, RouteParameters, Router};
2222
use crate::util::errors::APIError;
@@ -32,6 +32,12 @@ use core::ops::Deref;
3232
use crate::prelude::*;
3333
use crate::sync::Mutex;
3434

35+
/// The number of ticks of [`ChannelManager::timer_tick_occurred`] until we time-out the idempotency
36+
/// of payments by [`PaymentId`]. See [`OutboundPayments::remove_stale_payments`].
37+
///
38+
/// [`ChannelManager::timer_tick_occurred`]: crate::ln::channelmanager::ChannelManager::timer_tick_occurred
39+
pub(crate) const IDEMPOTENCY_TIMEOUT_TICKS: u8 = 7;
40+
3541
/// The number of ticks of [`ChannelManager::timer_tick_occurred`] until an invoice request without
3642
/// a response is timed out.
3743
///

lightning/src/ln/payment_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ use crate::sign::EntropySource;
1717
use crate::chain::transaction::OutPoint;
1818
use crate::events::{ClosureReason, Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider, PathFailure, PaymentFailureReason, PaymentPurpose};
1919
use crate::ln::channel::EXPIRE_PREV_CONFIG_TICKS;
20-
use crate::ln::channelmanager::{BREAKDOWN_TIMEOUT, MPP_TIMEOUT_TICKS, MIN_CLTV_EXPIRY_DELTA, PaymentId, PaymentSendFailure, IDEMPOTENCY_TIMEOUT_TICKS, RecentPaymentDetails, RecipientOnionFields, HTLCForwardInfo, PendingHTLCRouting, PendingAddHTLCInfo};
20+
use crate::ln::channelmanager::{BREAKDOWN_TIMEOUT, MPP_TIMEOUT_TICKS, MIN_CLTV_EXPIRY_DELTA, PaymentId, PaymentSendFailure, RecentPaymentDetails, RecipientOnionFields, HTLCForwardInfo, PendingHTLCRouting, PendingAddHTLCInfo};
2121
use crate::ln::features::Bolt11InvoiceFeatures;
2222
use crate::ln::{msgs, ChannelId, PaymentSecret, PaymentPreimage};
2323
use crate::ln::msgs::ChannelMessageHandler;
24-
use crate::ln::outbound_payment::Retry;
24+
use crate::ln::outbound_payment::{IDEMPOTENCY_TIMEOUT_TICKS, Retry};
2525
use crate::routing::gossip::{EffectiveCapacity, RoutingFees};
2626
use crate::routing::router::{get_route, Path, PaymentParameters, Route, Router, RouteHint, RouteHintHop, RouteHop, RouteParameters, find_route};
2727
use crate::routing::scoring::ChannelUsage;

0 commit comments

Comments
 (0)