From fc444741f1c179a12e1a380005c15253877d13b4 Mon Sep 17 00:00:00 2001 From: Jeff Date: Thu, 27 Jan 2022 11:11:57 -0500 Subject: [PATCH] move constant to new header create llarp/constants/time.hpp for time/duration constants --- llarp/constants/time.hpp | 10 ++++++++++ llarp/router/router.cpp | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 llarp/constants/time.hpp diff --git a/llarp/constants/time.hpp b/llarp/constants/time.hpp new file mode 100644 index 000000000..69866e2c8 --- /dev/null +++ b/llarp/constants/time.hpp @@ -0,0 +1,10 @@ +#pragma once + +#include + +namespace llarp +{ + using namespace std::literals; + /// how big of a time skip before we reset network state + constexpr auto TimeskipDetectedDuration = 1min; +} // namespace llarp diff --git a/llarp/router/router.cpp b/llarp/router/router.cpp index 94110689b..835850e75 100644 --- a/llarp/router/router.cpp +++ b/llarp/router/router.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -807,7 +808,6 @@ namespace llarp return; // LogDebug("tick router"); const auto now = Now(); - constexpr auto TimeskipDetectedDuration = 1min; if (const auto delta = now - _lastTick; _lastTick != 0s and delta > TimeskipDetectedDuration) { // we detected a time skip into the futre, thaw the network