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 6ccd751 commit da6b69eCopy full SHA for da6b69e
lightning-invoice/src/lib.rs
@@ -1208,7 +1208,9 @@ impl Invoice {
1208
/// Returns whether the expiry time would pass at the given point in time.
1209
/// `at_time` is the timestamp as a duration since the UNIX epoch.
1210
pub fn would_expire(&self, at_time: Duration) -> bool {
1211
- self.duration_since_epoch().saturating_add(self.expiry_time()) < at_time
+ self.duration_since_epoch()
1212
+ .checked_add(self.expiry_time())
1213
+ .unwrap_or_else(|| Duration::new(u64::max_value(), 1_000_000_000 - 1)) < at_time
1214
}
1215
1216
/// Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
0 commit comments