Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Add error log if block not produced in block_interval. #704
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Dec 27, 2017
1 parent 9c09d8f commit eb4e9e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libraries/chain/chain_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,12 @@ const producer_object& chain_controller::validate_block_header(uint32_t skip, co
("head_block_id",head_block_id())("next.prev",next_block.previous));
EOS_ASSERT(head_block_time() < (fc::time_point)next_block.timestamp, block_validate_exception, "",
("head_block_time",head_block_time())("next",next_block.timestamp)("blocknum",next_block.block_num()));
if (next_block.timestamp > head_block_time() + block_interval()) {
elog("head_block_time ${h}, next_block ${t}, \"block_interval ${bi}",
("h", head_block_time())("t", next_block.timestamp)("bi", block_interval()));
elog("Did not produce block within block_interval ${bi}, took ${t}ms)",
("bi", block_interval())("t", (next_block.timestamp - head_block_time()).count() / 1000));
}
if (next_block.block_num() % config::blocks_per_round != 0) {
EOS_ASSERT(!next_block.new_producers, block_validate_exception,
"Producer changes may only occur at the end of a round.");
Expand Down

0 comments on commit eb4e9e6

Please sign in to comment.