File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
testnet/stacks-node/src/nakamoto_node Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,8 @@ jobs:
143
143
- tests::signer::v0::outgoing_signers_ignore_block_proposals
144
144
- tests::signer::v0::injected_signatures_are_ignored_across_boundaries
145
145
- tests::signer::v0::fast_sortition
146
+ - tests::signer::v0::single_miner_empty_sortition
147
+ - tests::signer::v0::multiple_miners_empty_sortition
146
148
- tests::nakamoto_integrations::burn_ops_integration_test
147
149
- tests::nakamoto_integrations::check_block_heights
148
150
- tests::nakamoto_integrations::clarity_burn_state
Original file line number Diff line number Diff line change @@ -138,6 +138,15 @@ pub enum MinerReason {
138
138
} ,
139
139
}
140
140
141
+ impl MinerReason {
142
+ pub fn is_late_block ( & self ) -> bool {
143
+ match self {
144
+ Self :: BlockFound { ref late } => * late,
145
+ Self :: Extended { .. } => false ,
146
+ }
147
+ }
148
+ }
149
+
141
150
impl std:: fmt:: Display for MinerReason {
142
151
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
143
152
match self {
@@ -434,6 +443,11 @@ impl BlockMinerThread {
434
443
"Failed to open chainstate DB. Cannot mine! {e:?}"
435
444
) )
436
445
} ) ?;
446
+ if self . last_block_mined . is_some ( ) && self . reason . is_late_block ( ) {
447
+ info ! ( "Miner: finished mining a late tenure" ) ;
448
+ return Err ( NakamotoNodeError :: StacksTipChanged ) ;
449
+ }
450
+
437
451
let new_block = loop {
438
452
// If we're mock mining, we may not have processed the block that the
439
453
// actual tenure winner committed to yet. So, before attempting to
You can’t perform that action at this time.
0 commit comments