Skip to content

Commit 859f637

Browse files
committed
Implement Flow for OffersMessageFlow
1 parent 8adea39 commit 859f637

File tree

3 files changed

+508
-12
lines changed

3 files changed

+508
-12
lines changed

lightning/src/ln/channelmanager.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10202,7 +10202,7 @@ macro_rules! create_refund_builder { ($self: ident, $builder: ty) => {
1020210202
/// Sending multiple requests increases the chances of successful delivery in case some
1020310203
/// paths are unavailable. However, only one invoice for a given [`PaymentId`] will be paid,
1020410204
/// even if multiple invoices are received.
10205-
const OFFERS_MESSAGE_REQUEST_LIMIT: usize = 10;
10205+
pub const OFFERS_MESSAGE_REQUEST_LIMIT: usize = 10;
1020610206

1020710207
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>
1020810208
where

lightning/src/ln/inbound_payment.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ pub fn create_from_hash(keys: &ExpandedKey, min_value_msat: Option<u64>, payment
194194
}
195195

196196
#[cfg(async_payments)]
197-
pub(super) fn create_for_spontaneous_payment(
197+
pub(crate) fn create_for_spontaneous_payment(
198198
keys: &ExpandedKey, min_value_msat: Option<u64>, invoice_expiry_delta_secs: u32,
199199
current_time: u64, min_final_cltv_expiry_delta: Option<u16>
200200
) -> Result<PaymentSecret, ()> {
@@ -213,7 +213,7 @@ pub(super) fn create_for_spontaneous_payment(
213213
Ok(construct_payment_secret(&iv_bytes, &metadata_bytes, &keys.metadata_key))
214214
}
215215

216-
pub(super) fn calculate_absolute_expiry(highest_seen_timestamp: u64, invoice_expiry_delta_secs: u32) -> u64 {
216+
pub(crate) fn calculate_absolute_expiry(highest_seen_timestamp: u64, invoice_expiry_delta_secs: u32) -> u64 {
217217
// We assume that highest_seen_timestamp is pretty close to the current time - it's updated when
218218
// we receive a new block with the maximum time we've seen in a header. It should never be more
219219
// than two hours in the future. Thus, we add two hours here as a buffer to ensure we

0 commit comments

Comments
 (0)