Skip to content

Commit 3a25bdb

Browse files
committed
Drop now-unused public MAX_SHORT_LIVED_RELATIVE_EXPIRY constant
1 parent 55baa15 commit 3a25bdb

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2964,19 +2964,6 @@ const MAX_PEER_STORAGE_SIZE: usize = 1024;
29642964
/// many peers we reject new (inbound) connections.
29652965
const MAX_NO_CHANNEL_PEERS: usize = 250;
29662966

2967-
/// The maximum expiration from the current time where an [`Offer`] or [`Refund`] is considered
2968-
/// short-lived, while anything with a greater expiration is considered long-lived.
2969-
///
2970-
/// Using [`ChannelManager::create_offer_builder`] or [`ChannelManager::create_refund_builder`],
2971-
/// will include a [`BlindedMessagePath`] created using [`MessageRouter::create_blinded_paths`].
2972-
///
2973-
/// Using compact [`BlindedMessagePath`]s may provide better privacy as the [`MessageRouter`] could select
2974-
/// more hops. However, since they use short channel ids instead of pubkeys, they are more likely to
2975-
/// become invalid over time as channels are closed. Thus, they are only suitable for short-term use.
2976-
///
2977-
/// [`BlindedMessagePath`]: crate::blinded_path::message::BlindedMessagePath
2978-
pub const MAX_SHORT_LIVED_RELATIVE_EXPIRY: Duration = Duration::from_secs(60 * 60 * 24);
2979-
29802967
/// Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
29812968
/// These include payments that have yet to find a successful path, or have unresolved HTLCs.
29822969
#[derive(Debug, PartialEq)]
@@ -11640,8 +11627,8 @@ macro_rules! create_refund_builder { ($self: ident, $builder: ty) => {
1164011627
///
1164111628
/// # Privacy
1164211629
///
11643-
/// Uses [`MessageRouter`] to construct a [`BlindedMessagePath`] for the refund based on the given
11644-
/// `absolute_expiry` according to [`MAX_SHORT_LIVED_RELATIVE_EXPIRY`]. See those docs for
11630+
/// Uses [`MessageRouter`] to construct a [`BlindedMessagePath`].
11631+
/// See those docs for
1164511632
/// privacy implications.
1164611633
///
1164711634
/// Also, uses a derived payer id in the refund for payer privacy.

lightning/src/ln/offers_tests.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ use crate::blinded_path::message::BlindedMessagePath;
5050
use crate::blinded_path::payment::{Bolt12OfferContext, Bolt12RefundContext, PaymentContext};
5151
use crate::blinded_path::message::OffersContext;
5252
use crate::events::{ClosureReason, Event, HTLCHandlingFailureType, PaidBolt12Invoice, PaymentFailureReason, PaymentPurpose};
53-
use crate::ln::channelmanager::{Bolt12PaymentError, MAX_SHORT_LIVED_RELATIVE_EXPIRY, PaymentId, RecentPaymentDetails, RecipientOnionFields, Retry, self};
53+
use crate::ln::channelmanager::{Bolt12PaymentError, PaymentId, RecentPaymentDetails, RecipientOnionFields, Retry, self};
5454
use crate::types::features::Bolt12InvoiceFeatures;
5555
use crate::ln::functional_test_utils::*;
5656
use crate::ln::msgs::{BaseMessageHandler, ChannelMessageHandler, Init, NodeAnnouncement, OnionMessage, OnionMessageHandler, RoutingMessageHandler, SocketAddress, UnsignedGossipMessage, UnsignedNodeAnnouncement};
@@ -67,6 +67,10 @@ use crate::routing::router::{PaymentParameters, RouteParameters, RouteParameters
6767
use crate::sign::{NodeSigner, Recipient};
6868
use crate::util::ser::Writeable;
6969

70+
/// This used to determine whether we built a compact path or not, but now its just a random
71+
/// constant we apply to blinded path expiry in these tests.
72+
const MAX_SHORT_LIVED_RELATIVE_EXPIRY: Duration = Duration::from_secs(60 * 60 * 24);
73+
7074
use crate::prelude::*;
7175

7276
macro_rules! expect_recent_payment {

0 commit comments

Comments
 (0)