@@ -306,7 +306,7 @@ bool header::is_invalid_proof_of_work(uint32_t proof_of_work_limit,
306
306
// ****************************************************************************
307
307
// CONSENSUS: 32 bit unsigned unix time overflows in 2106.
308
308
// ****************************************************************************
309
- bool header::is_invalid_timestamp (
309
+ bool header::is_futuristic_timestamp (
310
310
uint32_t timestamp_limit_seconds) const NOEXCEPT
311
311
{
312
312
using namespace std ::chrono;
@@ -324,7 +324,7 @@ code header::check(uint32_t timestamp_limit_seconds,
324
324
{
325
325
if (is_invalid_proof_of_work (proof_of_work_limit, scrypt))
326
326
return error::invalid_proof_of_work;
327
- if (is_invalid_timestamp (timestamp_limit_seconds))
327
+ if (is_futuristic_timestamp (timestamp_limit_seconds))
328
328
return error::futuristic_timestamp;
329
329
330
330
return error::block_success;
@@ -339,11 +339,11 @@ code header::check(uint32_t timestamp_limit_seconds,
339
339
// All other work comparisons performed on expanded/normalized bits values.
340
340
code header::accept (const context& ctx) const NOEXCEPT
341
341
{
342
- if (version_ < ctx.minimum_block_version )
343
- return error::invalid_block_version ;
344
- if (timestamp_ <= ctx.median_time_past )
345
- return error::timestamp_too_early ;
346
- if (bits_ != ctx.work_required )
342
+ if (ctx.is_insufficient_version (version_) )
343
+ return error::insufficient_block_version ;
344
+ if (ctx.is_anachronistic_timestamp (timestamp_) )
345
+ return error::anachronistic_timestamp ;
346
+ if (ctx.is_invalid_work (bits_) )
347
347
return error::incorrect_proof_of_work;
348
348
349
349
return error::block_success;
0 commit comments