Use `MonotonicTime` as `Instant` shifted by 10 years forward
[rust-lightning] / lightning / src / ln / outbound_payment.rs
index 2ac24baa58b3466315c2628c711f17e4f3d17d73..546dc6c5bcd93171411263ff1c77229a08ea2ae1 100644 (file)
@@ -239,7 +239,7 @@ impl Retry {
                        },
                        #[cfg(all(not(feature = "no-std"), not(test)))]
                        (Retry::Timeout(max_duration), PaymentAttempts { first_attempted_at, .. }) =>
-                               *max_duration >= std::time::Instant::now().duration_since(*first_attempted_at),
+                               *max_duration >= crate::util::time::MonotonicTime::now().duration_since(*first_attempted_at),
                        #[cfg(all(not(feature = "no-std"), test))]
                        (Retry::Timeout(max_duration), PaymentAttempts { first_attempted_at, .. }) =>
                                *max_duration >= SinceEpoch::now().duration_since(*first_attempted_at),
@@ -274,7 +274,7 @@ pub(crate) struct PaymentAttemptsUsingTime<T: Time> {
 }
 
 #[cfg(not(any(feature = "no-std", test)))]
-type ConfiguredTime = std::time::Instant;
+type ConfiguredTime = crate::util::time::MonotonicTime;
 #[cfg(feature = "no-std")]
 type ConfiguredTime = crate::util::time::Eternity;
 #[cfg(all(not(feature = "no-std"), test))]