move constant to new header

create llarp/constants/time.hpp for time/duration constants
pull/1844/head
Jeff 2 years ago
parent 5fac6c84d8
commit fc444741f1

@ -0,0 +1,10 @@
#pragma once
#include <chrono>
namespace llarp
{
using namespace std::literals;
/// how big of a time skip before we reset network state
constexpr auto TimeskipDetectedDuration = 1min;
} // namespace llarp

@ -4,6 +4,7 @@
#include <llarp/config/config.hpp>
#include <llarp/constants/proto.hpp>
#include <llarp/constants/files.hpp>
#include <llarp/constants/time.hpp>
#include <llarp/crypto/crypto_libsodium.hpp>
#include <llarp/crypto/crypto.hpp>
#include <llarp/dht/context.hpp>
@ -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

Loading…
Cancel
Save