aboutsummaryrefslogtreecommitdiff
path: root/src/timedata.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/timedata.h')
-rw-r--r--src/timedata.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/timedata.h b/src/timedata.h
index 2f039d5465..ed2d8639f7 100644
--- a/src/timedata.h
+++ b/src/timedata.h
@@ -5,9 +5,12 @@
#ifndef BITCOIN_TIMEDATA_H
#define BITCOIN_TIMEDATA_H
+#include <util/time.h>
+
#include <algorithm>
-#include <assert.h>
-#include <stdint.h>
+#include <cassert>
+#include <chrono>
+#include <cstdint>
#include <vector>
static const int64_t DEFAULT_MAX_TIME_ADJUSTMENT = 70 * 60;
@@ -73,6 +76,7 @@ public:
/** Functions to keep track of adjusted P2P time */
int64_t GetTimeOffset();
int64_t GetAdjustedTime();
+inline NodeSeconds AdjustedTime() { return Now<NodeSeconds>() + std::chrono::seconds{GetTimeOffset()}; }
void AddTimeData(const CNetAddr& ip, int64_t nTime);
/**