From 83f9e4666899a04f98da9185e526479de33aa54b Mon Sep 17 00:00:00 2001 From: BhuzOr Date: Sun, 4 Jun 2017 15:16:49 +0200 Subject: [PATCH] Validate block timestamps Reject blocks with timestamp too far in the future Backport from BitShares: https://github.com/bitshares/bitshares-core/pull/17 --- libraries/app/application.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/app/application.cpp b/libraries/app/application.cpp index ea5789b8..a700837a 100644 --- a/libraries/app/application.cpp +++ b/libraries/app/application.cpp @@ -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);