File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -436,9 +436,13 @@ fn try_mine_microblock(
436436 if microblock_miner. last_mined + ( microblock_miner. frequency as u128 )
437437 < get_epoch_time_ms ( )
438438 {
439- // opportunistically try and mine, but only if there's no attachable blocks
440- let num_attachable =
441- StacksChainState :: count_attachable_staging_blocks ( chainstate. db ( ) , 1 , 0 ) ?;
439+ // opportunistically try and mine, but only if there are no attachable blocks in
440+ // recent history (i.e. in the last 10 minutes)
441+ let num_attachable = StacksChainState :: count_attachable_staging_blocks (
442+ chainstate. db ( ) ,
443+ 1 ,
444+ get_epoch_time_secs ( ) - 600 ,
445+ ) ?;
442446 if num_attachable == 0 {
443447 match mine_one_microblock ( & mut microblock_miner, sortdb, chainstate, & mem_pool)
444448 {
@@ -453,6 +457,8 @@ fn try_mine_microblock(
453457 warn ! ( "Failed to mine one microblock: {:?}" , & e) ;
454458 }
455459 }
460+ } else {
461+ debug ! ( "Will not mine microblocks yet -- have {} attachable blocks that arrived in the last 10 minutes" , num_attachable) ;
456462 }
457463 }
458464 microblock_miner. last_mined = get_epoch_time_ms ( ) ;
You can’t perform that action at this time.
0 commit comments