Skip to content

Commit 0abfc99

Browse files
shaavanvalentinewallace
authored andcommitted
Implement OffersMessageFlow functions
1 parent 8d9a6ad commit 0abfc99

File tree

3 files changed

+839
-17
lines changed

3 files changed

+839
-17
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ use crate::ln::msgs::{BaseMessageHandler, ChannelMessageHandler, CommitmentUpdat
6565
#[cfg(test)]
6666
use crate::ln::outbound_payment;
6767
use crate::ln::outbound_payment::{Bolt11PaymentError, OutboundPayments, PendingOutboundPayment, RetryableInvoiceRequest, SendAlongPathArgs, StaleExpiration};
68+
use crate::offers::flow::OFFERS_MESSAGE_REQUEST_LIMIT;
6869
use crate::offers::invoice::{Bolt12Invoice, DEFAULT_RELATIVE_EXPIRY, DerivedSigningPubkey, ExplicitSigningPubkey, InvoiceBuilder, UnsignedBolt12Invoice};
6970
use crate::offers::invoice_error::InvoiceError;
7071
use crate::offers::invoice_request::{InvoiceRequest, InvoiceRequestBuilder};
@@ -10349,13 +10350,6 @@ macro_rules! create_refund_builder { ($self: ident, $builder: ty) => {
1034910350
}
1035010351
} }
1035110352

10352-
/// Defines the maximum number of [`OffersMessage`] including different reply paths to be sent
10353-
/// along different paths.
10354-
/// Sending multiple requests increases the chances of successful delivery in case some
10355-
/// paths are unavailable. However, only one invoice for a given [`PaymentId`] will be paid,
10356-
/// even if multiple invoices are received.
10357-
const OFFERS_MESSAGE_REQUEST_LIMIT: usize = 10;
10358-
1035910353
impl<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, MR: Deref, L: Deref> ChannelManager<M, T, ES, NS, SP, F, R, MR, L>
1036010354
where
1036110355
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,

lightning/src/ln/inbound_payment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ pub(super) fn create_for_spontaneous_payment(
236236
Ok(construct_payment_secret(&iv_bytes, &metadata_bytes, &keys.metadata_key))
237237
}
238238

239-
pub(super) fn calculate_absolute_expiry(
239+
pub(crate) fn calculate_absolute_expiry(
240240
highest_seen_timestamp: u64, invoice_expiry_delta_secs: u32,
241241
) -> u64 {
242242
// We assume that highest_seen_timestamp is pretty close to the current time - it's updated when

0 commit comments

Comments
 (0)