aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.h
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-05-30 15:44:25 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-05-30 15:44:25 -0500
commit4267a0bb516ec2b35a8a47ba72f0d78adcd083d7 (patch)
treed61b745f429c803601f5755260a721a0740f9a01 /src/cryptonote_core/blockchain.h
parentMerge pull request #3251 (diff)
parentUse median timestamp if current time renders a block invalid. (diff)
downloadmonero-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.h7
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"