fix: start chain-liveness thread before waiting for sortitions

This commit is contained in:
Jude Nelson
2022-12-31 03:16:38 +00:00
parent 270c5e04dd
commit 59c9c3a30d

View File

@@ -845,7 +845,9 @@ impl RunLoop {
let mut last_burn_pox_reorg_recover_time = 0;
let mut last_stacks_pox_reorg_recover_time = 0;
debug!("Chain-liveness thread start!");
while globals.keep_running() {
debug!("Chain-liveness checkup");
Self::drive_pox_reorg_burn_block_processing(
&globals,
&config,
@@ -862,7 +864,7 @@ impl RunLoop {
&mut last_stacks_pox_reorg_recover_time,
);
sleep_ms(1000);
sleep_ms(3000);
}
debug!("Chain-liveness thread exit!");
@@ -966,6 +968,7 @@ impl RunLoop {
// Boot up the p2p network and relayer, and figure out how many sortitions we have so far
// (it could be non-zero if the node is resuming from chainstate)
let mut node = StacksNode::spawn(self, globals.clone(), relay_recv, attachments_rx);
let liveness_thread = self.spawn_chain_liveness_thread(globals.clone());
// Wait for all pending sortitions to process
let burnchain_db = burnchain_config
@@ -1000,7 +1003,6 @@ impl RunLoop {
);
let mut last_tenure_sortition_height = 0;
let liveness_thread = self.spawn_chain_liveness_thread(globals.clone());
loop {
if !globals.keep_running() {