aboutsummaryrefslogtreecommitdiff
path: root/src/chain.h
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-08-05 14:45:30 +0200
committerMacroFake <falke.marco@gmail.com>2022-08-05 14:45:02 +0200
commitfa3be799fe951a7ea9b4de78d5a907c6db71eeb8 (patch)
tree31c48c6ccf090d3961f6acfbd04d29b3ff7034ae /src/chain.h
parent7d82f86341072311a0e62807213e17925efde299 (diff)
Add time helpers
To be used in the next commit
Diffstat (limited to 'src/chain.h')
-rw-r--r--src/chain.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/chain.h b/src/chain.h
index 1c5cd3f1f6..cc1d9e2d22 100644
--- a/src/chain.h
+++ b/src/chain.h
@@ -12,6 +12,7 @@
#include <primitives/block.h>
#include <sync.h>
#include <uint256.h>
+#include <util/time.h>
#include <vector>
@@ -275,6 +276,11 @@ public:
*/
bool HaveTxsDownloaded() const { return nChainTx != 0; }
+ NodeSeconds Time() const
+ {
+ return NodeSeconds{std::chrono::seconds{nTime}};
+ }
+
int64_t GetBlockTime() const
{
return (int64_t)nTime;