Validate block timestamps

Reject blocks with timestamp too far in the future
Backport from BitShares: https://github.com/bitshares/bitshares-core/pull/17
This commit is contained in:
BhuzOr 2017-06-04 15:16:49 +02:00 committed by GitHub
parent 4a75af7dc9
commit 83f9e46668

View file

@ -493,6 +493,7 @@ namespace detail {
{ try {
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)
{
const auto& witness = blk_msg.block.witness(*_chain_db);