Skip to content

Commit e9051f8

Browse files
committed
Explain no-std Bolt11Invoice::duration_since_epoch
1 parent 716758f commit e9051f8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lightning/src/ln/channelmanager.rs

+4
Original file line numberDiff line numberDiff line change
@@ -9268,6 +9268,10 @@ where
92689268
SystemTime::now().duration_since(SystemTime::UNIX_EPOCH)
92699269
.expect("SystemTime::now() should be after SystemTime::UNIX_EPOCH")
92709270
};
9271+
9272+
// This may be up to 2 hours in the future because of bitcoin's block time rule or about
9273+
// 10-30 minutes in the past if a block hasn't been found recently. This should be fine as
9274+
// the default invoice expiration is 2 hours, though shorter expirations may be problematic.
92719275
#[cfg(not(feature = "std"))]
92729276
let duration_since_epoch =
92739277
Duration::from_secs(self.highest_seen_timestamp.load(Ordering::Acquire) as u64);

0 commit comments

Comments
 (0)