Skip to content

Commit

Permalink
GH-525 Move scope_exit of schedule_production_loop since any call sho…
Browse files Browse the repository at this point in the history
…uld restart block because speculative block may have been interrupted.
  • Loading branch information
heifner committed Dec 15, 2022
1 parent 7468ded commit d0d7fa7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugins/producer_plugin/producer_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,11 @@ class producer_plugin_impl : public std::enable_shared_from_this<producer_plugin
return false;
}

// start a new speculative block, speculative start_block may have been interrupted
auto ensure = fc::make_scoped_exit([this](){
schedule_production_loop();
});

const auto& id = block_id ? *block_id : block->calculate_id();
auto blk_num = block->block_num();

Expand All @@ -457,11 +462,6 @@ class producer_plugin_impl : public std::enable_shared_from_this<producer_plugin
// abort the pending block
abort_block();

// exceptions throw out, make sure we restart our loop
auto ensure = fc::make_scoped_exit([this](){
schedule_production_loop();
});

// push the new block
auto handle_error = [&](const auto& e)
{
Expand Down

0 comments on commit d0d7fa7

Please sign in to comment.