Merge pull request #3731

a66f152 Use median timestamp if current time renders a block invalid. (thaerkh)
This commit is contained in:
luigi1111
2018-05-30 15:44:25 -05:00
2 changed files with 15 additions and 6 deletions
+5 -2
View File
@@ -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"