application.cpp: Validate block timestamps #645

This commit is contained in:
abitmore 2016-07-30 05:39:41 +08:00
parent 3865dd1573
commit 2cf8fb62c9

View file

@ -508,6 +508,7 @@ namespace detail {
{ try { { try {
auto latency = graphene::time::now() - blk_msg.block.timestamp; auto latency = graphene::time::now() - blk_msg.block.timestamp;
FC_ASSERT( (latency.count()/1000) > -5000, "Rejecting block with timestamp in the future" );
if (!sync_mode || blk_msg.block.block_num() % 10000 == 0) if (!sync_mode || blk_msg.block.block_num() % 10000 == 0)
{ {
const auto& witness = blk_msg.block.witness(*_chain_db); const auto& witness = blk_msg.block.witness(*_chain_db);