Skip to content

Commit 4d24f63

Browse files
Correct default expiry.
We previously stated in the codebase that the default invoice expiry stated in the spec is 2 hours. It's actually 1 hour.
1 parent 0b1f0a7 commit 4d24f63

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ fn get_payment_secret_hash(dest: &ChanMan, payment_id: &mut u8) -> Option<(Payme
272272
let mut payment_hash;
273273
for _ in 0..256 {
274274
payment_hash = PaymentHash(Sha256::hash(&[*payment_id; 1]).into_inner());
275-
if let Ok(payment_secret) = dest.create_inbound_payment_for_hash(payment_hash, None, 7200, 0) {
275+
if let Ok(payment_secret) = dest.create_inbound_payment_for_hash(payment_hash, None, 3600, 0) {
276276
return Some((payment_secret, payment_hash));
277277
}
278278
*payment_id = payment_id.wrapping_add(1);

lightning-invoice/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ where
5454

5555
let (payment_hash, payment_secret) = channelmanager.create_inbound_payment(
5656
amt_msat,
57-
7200, // default invoice expiry is 2 hours
57+
3600, // default invoice expiry is 1 hours
5858
0,
5959
);
6060
let our_node_pubkey = channelmanager.get_our_node_id();

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3477,7 +3477,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
34773477
/// `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
34783478
/// in excess of the current time. This should roughly match the expiry time set in the invoice.
34793479
/// After this many seconds, we will remove the inbound payment, resulting in any attempts to
3480-
/// pay the invoice failing. The BOLT spec suggests 7,200 secs as a default validity time for
3480+
/// pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
34813481
/// invoices when no timeout is set.
34823482
///
34833483
/// Note that we use block header time to time-out pending inbound payments (with some margin

0 commit comments

Comments
 (0)