diff options
author | Thaer Khawaja <thaer.khawaja@gmail.com> | 2018-04-29 19:20:27 -0700 |
---|---|---|
committer | Thaer Khawaja <thaer.khawaja@gmail.com> | 2018-05-13 11:58:05 -0700 |
commit | a66f152f75f66ba165b3eb8184c8ee75e3df554c (patch) | |
tree | 868457f57af29d9bb5511ae0b4f7df1fe6288fb4 /src/cryptonote_core/blockchain.h | |
parent | Merge pull request #3719 (diff) | |
download | monero-a66f152f75f66ba165b3eb8184c8ee75e3df554c.tar.xz |
Use median timestamp if current time renders a block invalid.
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 61096fb26..98f086417 100644 --- a/src/cryptonote_core/blockchain.h +++ b/src/cryptonote_core/blockchain.h @@ -1292,10 +1292,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 @@ -1308,7 +1310,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" |