diff options
author | MacroFake <falke.marco@gmail.com> | 2022-08-05 14:45:30 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-08-05 14:45:02 +0200 |
commit | fa3be799fe951a7ea9b4de78d5a907c6db71eeb8 (patch) | |
tree | 31c48c6ccf090d3961f6acfbd04d29b3ff7034ae /src/primitives | |
parent | 7d82f86341072311a0e62807213e17925efde299 (diff) |
Add time helpers
To be used in the next commit
Diffstat (limited to 'src/primitives')
-rw-r--r-- | src/primitives/block.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/primitives/block.h b/src/primitives/block.h index 2d10853607..76aba6c899 100644 --- a/src/primitives/block.h +++ b/src/primitives/block.h @@ -9,6 +9,7 @@ #include <primitives/transaction.h> #include <serialize.h> #include <uint256.h> +#include <util/time.h> /** Nodes collect new transactions into a block, hash them into a hash tree, * and scan through nonce values to make the block's hash satisfy proof-of-work @@ -52,6 +53,11 @@ public: uint256 GetHash() const; + NodeSeconds Time() const + { + return NodeSeconds{std::chrono::seconds{nTime}}; + } + int64_t GetBlockTime() const { return (int64_t)nTime; |