From 1ce4d36532e7351ca1c737eb54fe26c4665005b6 Mon Sep 17 00:00:00 2001 From: Abit Date: Sun, 4 Jun 2017 01:47:02 +0200 Subject: [PATCH] Check block latency after logging. --- libraries/app/application.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/app/application.cpp b/libraries/app/application.cpp index fb6d70aa..823ee6bc 100644 --- a/libraries/app/application.cpp +++ b/libraries/app/application.cpp @@ -524,8 +524,6 @@ namespace detail { std::vector& contained_transaction_message_ids) override { try { - auto latency = fc::time_point::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); @@ -538,6 +536,8 @@ namespace detail { ("w",witness_account.name) ("i",last_irr)("d",blk_msg.block.block_num()-last_irr) ); } + auto latency = fc::time_point::now() - blk_msg.block.timestamp; + FC_ASSERT( (latency.count()/1000) > -5000, "Rejecting block with timestamp in the future" ); try { // TODO: in the case where this block is valid but on a fork that's too old for us to switch to,