@@ -28,7 +28,7 @@ use stacks::chainstate::burn::db::sortdb::SortitionDB;
28
28
use stacks:: chainstate:: burn:: { BlockSnapshot , ConsensusHash } ;
29
29
use stacks:: chainstate:: nakamoto:: { NakamotoBlock , NakamotoChainState } ;
30
30
use stacks:: chainstate:: stacks:: boot:: { RewardSet , MINERS_NAME } ;
31
- use stacks:: chainstate:: stacks:: db:: StacksChainState ;
31
+ use stacks:: chainstate:: stacks:: db:: { StacksBlockHeaderTypes , StacksChainState } ;
32
32
use stacks:: chainstate:: stacks:: Error as ChainstateError ;
33
33
use stacks:: codec:: StacksMessageCodec ;
34
34
use stacks:: libstackerdb:: StackerDBChunkData ;
@@ -425,7 +425,17 @@ impl SignerCoordinator {
425
425
& parent_tenure_header. consensus_hash ,
426
426
) ?
427
427
. ok_or ( NakamotoNodeError :: UnexpectedChainState ) ?;
428
- if highest_in_tenure. index_block_hash ( ) != parent_block_id {
428
+ let highest_stacks_block_id = highest_in_tenure. index_block_hash ( ) ;
429
+ if & highest_stacks_block_id == block_id {
430
+ // the block was included in the chainstate since we last checked!
431
+ let StacksBlockHeaderTypes :: Nakamoto ( stored_block) =
432
+ highest_in_tenure. anchored_header
433
+ else {
434
+ error ! ( "Nakamoto miner produced a non-nakamoto block" ) ;
435
+ return Err ( NakamotoNodeError :: UnexpectedChainState ) ;
436
+ } ;
437
+ return Ok ( stored_block. signer_signature ) ;
438
+ } else if highest_stacks_block_id != parent_block_id {
429
439
info ! ( "SignCoordinator: Exiting due to new stacks tip" ) ;
430
440
return Err ( NakamotoNodeError :: StacksTipChanged ) ;
431
441
}
0 commit comments