@@ -194,7 +194,6 @@ use stacks::net::stackerdb::{StackerDBConfig, StackerDBSync, StackerDBs, MINER_S
194
194
use stacks:: net:: {
195
195
Error as NetError , NetworkResult , PeerNetworkComms , RPCHandlerArgs , ServiceFlags ,
196
196
} ;
197
- use stacks:: types:: StacksEpoch ;
198
197
use stacks:: util_lib:: strings:: { UrlString , VecDisplay } ;
199
198
use stacks:: { monitoring, version_string} ;
200
199
use stacks_common:: codec:: StacksMessageCodec ;
@@ -2274,20 +2273,9 @@ impl BlockMinerThread {
2274
2273
let burn_db_path = self . config . get_burn_db_file_path ( ) ;
2275
2274
let burn_db = SortitionDB :: open ( & burn_db_path, false , self . burnchain . pox_constants . clone ( ) )
2276
2275
. expect ( "FATAL: could not open sortition DB" ) ;
2277
- let epochs = SortitionDB :: get_stacks_epochs ( burn_db. conn ( ) )
2278
- . expect ( "Error while loading stacks epochs" ) ;
2279
- let epoch_index = StacksEpoch :: find_epoch ( & epochs, self . burn_block . block_height )
2280
- . unwrap_or_else ( || {
2281
- panic ! (
2282
- "BUG: block {} is not in a known epoch" ,
2283
- self . burn_block. block_height
2284
- )
2285
- } ) ;
2286
- let epoch_id = epochs
2287
- . get ( epoch_index)
2288
- . expect ( "BUG: no epoch at found index" )
2276
+ let epoch_id = SortitionDB :: get_stacks_epoch ( burn_db. conn ( ) , self . burn_block . block_height ) ?
2277
+ . expect ( "FATAL: no epoch defined" )
2289
2278
. epoch_id ;
2290
-
2291
2279
if epoch_id != StacksEpochId :: Epoch25 {
2292
2280
debug ! ( "Mock miner messaging is disabled for non-epoch 2.5 blocks." ;
2293
2281
"epoch_id" => epoch_id. to_string( )
@@ -2405,7 +2393,7 @@ impl BlockMinerThread {
2405
2393
& self . burn_block ,
2406
2394
& stackerdbs,
2407
2395
SignerMessage :: MockMinerMessage ( message. clone ( ) ) ,
2408
- MinerSlotID :: MockMinerMessage ,
2396
+ MinerSlotID :: BlockProposal , // There is no specific slot for mock miner messages
2409
2397
self . config . is_mainnet ( ) ,
2410
2398
& mut miners_stackerdb,
2411
2399
& election_sortition,
0 commit comments