diff options
Diffstat (limited to 'src/primitives')
-rw-r--r-- | src/primitives/block.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/primitives/block.h b/src/primitives/block.h index 2d10853607..2e26e6c426 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; @@ -117,7 +123,7 @@ struct CBlockLocator CBlockLocator() {} - explicit CBlockLocator(const std::vector<uint256>& vHaveIn) : vHave(vHaveIn) {} + explicit CBlockLocator(std::vector<uint256>&& have) : vHave(std::move(have)) {} SERIALIZE_METHODS(CBlockLocator, obj) { |