Merge pull request #3280 from stacks-network/fix/chill-initial-header-sync

fix: avoid pegging system resources during initial header sync when bitcoind rpc isn't yet available
This commit is contained in:
Aaron Blankstein
2022-09-07 14:01:27 -05:00
committed by GitHub

View File

@@ -72,7 +72,7 @@ use crate::util_lib::db::Error as db_error;
use stacks_common::address::public_keys_to_address_hash;
use stacks_common::address::AddressHashMode;
use stacks_common::deps_common::bitcoin::util::hash::Sha256dHash as BitcoinSha256dHash;
use stacks_common::util::get_epoch_time_ms;
use stacks_common::util::{get_epoch_time_ms, sleep_ms};
use stacks_common::util::get_epoch_time_secs;
use stacks_common::util::hash::to_hex;
use stacks_common::util::log;
@@ -584,6 +584,7 @@ impl Burnchain {
debug!("Fetch initial headers");
indexer.sync_headers(headers_height, None).map_err(|e| {
error!("Failed to sync initial headers");
sleep_ms(100);
e
})?;
}