Skip to content

Commit

Permalink
fix: do not broadcast block when mock-mining
Browse files Browse the repository at this point in the history
  • Loading branch information
obycode committed Dec 9, 2024
1 parent 565ad2a commit 1f79b52
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions testnet/stacks-node/src/nakamoto_node/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,11 @@ impl BlockMinerThread {
)
.expect("FATAL: could not open sortition DB");

if self.config.get_node_config(false).mock_mining {
// If we're mock mining, we don't actually broadcast the block.
return Ok(());
}

if self.config.miner.mining_key.is_none() {
return Err(NakamotoNodeError::MinerConfigurationFailed(
"No mining key configured, cannot mine",
Expand Down

0 comments on commit 1f79b52

Please sign in to comment.