diff --git a/libraries/plugins/witness/include/graphene/witness/witness.hpp b/libraries/plugins/witness/include/graphene/witness/witness.hpp index d2bfcd1290..9a22dcbd9a 100644 --- a/libraries/plugins/witness/include/graphene/witness/witness.hpp +++ b/libraries/plugins/witness/include/graphene/witness/witness.hpp @@ -84,6 +84,7 @@ class witness_plugin : public graphene::app::plugin { boost::program_options::variables_map _options; bool _production_enabled = false; + bool _shutting_down = false; uint32_t _required_witness_participation = 33 * GRAPHENE_1_PERCENT; uint32_t _production_skip_flags = graphene::chain::database::skip_nothing; diff --git a/libraries/plugins/witness/witness.cpp b/libraries/plugins/witness/witness.cpp index 1d2db30a73..a2066204f6 100644 --- a/libraries/plugins/witness/witness.cpp +++ b/libraries/plugins/witness/witness.cpp @@ -144,6 +144,7 @@ void witness_plugin::plugin_startup() void witness_plugin::plugin_shutdown() { // nothing to do + _shutting_down = true; } void witness_plugin::refresh_witness_key_cache() @@ -161,6 +162,8 @@ void witness_plugin::refresh_witness_key_cache() void witness_plugin::schedule_production_loop() { + if (_shutting_down) return; + //Schedule for the next second's tick regardless of chain state // If we would wait less than 50ms, wait for the whole second. fc::time_point now = fc::time_point::now();