@@ -192,23 +192,29 @@ void witness_plugin::schedule_production_loop()
192
192
193
193
block_production_condition::block_production_condition_enum witness_plugin::block_production_loop ()
194
194
{
195
- if (_shutting_down) return block_production_condition::block_production_condition_enum::shutdown;
196
-
197
195
block_production_condition::block_production_condition_enum result;
198
196
fc::limited_mutable_variant_object capture ( GRAPHENE_MAX_NESTED_OBJECTS );
199
- try
200
- {
201
- result = maybe_produce_block (capture);
202
- }
203
- catch ( const fc::canceled_exception& )
197
+
198
+ if (_shutting_down)
204
199
{
205
- // We're trying to exit. Go ahead and let this one out.
206
- throw ;
200
+ result = block_production_condition::shutdown;
207
201
}
208
- catch ( const fc:: exception & e )
202
+ else
209
203
{
210
- elog (" Got exception while generating block:\n ${e}" , (" e" , e.to_detail_string ()));
211
- result = block_production_condition::exception_producing_block;
204
+ try
205
+ {
206
+ result = maybe_produce_block (capture);
207
+ }
208
+ catch ( const fc::canceled_exception& )
209
+ {
210
+ // We're trying to exit. Go ahead and let this one out.
211
+ throw ;
212
+ }
213
+ catch ( const fc::exception & e )
214
+ {
215
+ elog (" Got exception while generating block:\n ${e}" , (" e" , e.to_detail_string ()));
216
+ result = block_production_condition::exception_producing_block;
217
+ }
212
218
}
213
219
214
220
switch ( result )
@@ -235,6 +241,12 @@ block_production_condition::block_production_condition_enum witness_plugin::bloc
235
241
case block_production_condition::exception_producing_block:
236
242
elog ( " exception producing block" );
237
243
break ;
244
+ case block_production_condition::shutdown:
245
+ ilog ( " shutdown producing block" );
246
+ return result;
247
+ default :
248
+ elog ( " unknown condition ${result} while producing block" , (" result" , (unsigned char )result) );
249
+ break ;
238
250
}
239
251
240
252
schedule_production_loop ();
0 commit comments