diff --git a/zebrad/src/components/miner.rs b/zebrad/src/components/miner.rs index b7003a138ba..ce6b1f02131 100644 --- a/zebrad/src/components/miner.rs +++ b/zebrad/src/components/miner.rs @@ -375,6 +375,13 @@ where "solver cancelled: getting a new block template or shutting down" ); } + + // If the blockchain is changing rapidly, limit how often we'll update the template. + // But if we're shutting down, do that immediately. + if template_receiver.has_changed().is_ok() && !is_shutting_down() { + sleep(Duration::from_secs(1)).await; + } + continue; };