Skip to content

Commit

Permalink
GH-525 Honor deadline if we can produce
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Dec 12, 2022
1 parent e63482a commit 40a7e34
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugins/producer_plugin/producer_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1682,10 +1682,11 @@ fc::time_point producer_plugin_impl::calculate_block_deadline( const fc::time_po
}

bool producer_plugin_impl::start_block_interrupted( const fc::time_point& deadline ) const {
if( _pending_block_mode == pending_block_mode::speculating ) {
return _received_block;
if( _pending_block_mode == pending_block_mode::producing ) {
return deadline <= fc::time_point::now();
}
return deadline <= fc::time_point::now();
// if we can produce then honor deadline so production starts on time
return (!_producers.empty() && deadline <= fc::time_point::now()) || _received_block;
}

producer_plugin_impl::start_block_result producer_plugin_impl::start_block() {
Expand Down

0 comments on commit 40a7e34

Please sign in to comment.