File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2381,6 +2381,15 @@ impl BlockMinerThread {
2381
2381
"chain_id" => message. chain_id,
2382
2382
"num_mock_signatures" => message. mock_signatures. len( ) ,
2383
2383
) ;
2384
+ let ( _, miners_info) =
2385
+ NakamotoChainState :: make_miners_stackerdb_config ( & burn_db, & self . burn_block ) ?;
2386
+
2387
+ // find out which slot we're in. If we are not the latest sortition winner, we should not be sending anymore messages anyway
2388
+ let idx = miners_info. get_latest_winner_index ( ) ;
2389
+ let sortitions = miners_info. get_sortitions ( ) ;
2390
+ let election_sortition = * sortitions
2391
+ . get ( idx as usize )
2392
+ . expect ( "FATAL: latest winner index out of bounds" ) ;
2384
2393
2385
2394
if let Err ( e) = SignCoordinator :: send_miners_message (
2386
2395
& miner_config. mining_key . expect ( "BUG: no mining key" ) ,
@@ -2391,7 +2400,7 @@ impl BlockMinerThread {
2391
2400
MinerSlotID :: MockMinerMessage ,
2392
2401
self . config . is_mainnet ( ) ,
2393
2402
& mut miners_stackerdb,
2394
- & self . burn_block . consensus_hash ,
2403
+ & election_sortition ,
2395
2404
) {
2396
2405
warn ! ( "Failed to send mock miner message: {:?}" , & e) ;
2397
2406
}
You can’t perform that action at this time.
0 commit comments