We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6002032 commit cdf670cCopy full SHA for cdf670c
lightning-invoice/src/lib.rs
@@ -88,9 +88,8 @@ pub use de::{ParseError, ParseOrSemanticError};
88
/// The number of bits used to represent timestamps as defined in BOLT 11.
89
const TIMESTAMP_BITS: usize = 35;
90
91
-/// The maximum timestamp that can be represented as a [`Duration`] since the UNIX epoch while
92
-/// allowing for adding an expiry without overflowing.
93
-const MAX_TIMESTAMP: u64 = core::u64::MAX >> (64 - TIMESTAMP_BITS);
+/// The maximum timestamp as [`Duration::as_secs`] since the UNIX epoch allowed by BOLT 11.
+const MAX_TIMESTAMP: u64 = (1 << TIMESTAMP_BITS) - 1;
94
95
/// Default expiry time as defined by [BOLT 11].
96
///
0 commit comments