diff options
author | luigi1111 <luigi1111w@gmail.com> | 2018-05-30 15:44:25 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2018-05-30 15:44:25 -0500 |
commit | 4267a0bb516ec2b35a8a47ba72f0d78adcd083d7 (patch) | |
tree | d61b745f429c803601f5755260a721a0740f9a01 /src/cryptonote_core/blockchain.h | |
parent | Merge pull request #3251 (diff) | |
parent | Use median timestamp if current time renders a block invalid. (diff) | |
download | monero-4267a0bb516ec2b35a8a47ba72f0d78adcd083d7.tar.xz |
Merge pull request #3731
a66f152 Use median timestamp if current time renders a block invalid. (thaerkh)
Diffstat (limited to 'src/cryptonote_core/blockchain.h')
-rw-r--r-- | src/cryptonote_core/blockchain.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h index 3dd9a6d69..769e608ca 100644 --- a/src/cryptonote_core/blockchain.h +++ b/src/cryptonote_core/blockchain.h @@ -1300,10 +1300,12 @@ namespace cryptonote * false otherwise * * @param b the block to be checked + * @param median_ts return-by-reference the median of timestamps * * @return true if the block's timestamp is valid, otherwise false */ - bool check_block_timestamp(const block& b) const; + bool check_block_timestamp(const block& b, uint64_t& median_ts) const; + bool check_block_timestamp(const block& b) const { uint64_t median_ts; return check_block_timestamp(b, median_ts); } /** * @brief checks a block's timestamp @@ -1316,7 +1318,8 @@ namespace cryptonote * * @return true if the block's timestamp is valid, otherwise false */ - bool check_block_timestamp(std::vector<uint64_t>& timestamps, const block& b) const; + bool check_block_timestamp(std::vector<uint64_t>& timestamps, const block& b, uint64_t& median_ts) const; + bool check_block_timestamp(std::vector<uint64_t>& timestamps, const block& b) const { uint64_t median_ts; return check_block_timestamp(timestamps, b, median_ts); } /** * @brief get the "adjusted time" |