static mut DATA_STORE: Option<Box<Store>> = None;
static mut PRINTER: Option<Box<Printer>> = None;
pub static START_SHUTDOWN: AtomicBool = AtomicBool::new(false);
+static SCANNING: AtomicBool = AtomicBool::new(false);
struct PeerState {
request: (u64, sha256d::Hash),
= (headers.last().unwrap().bitcoin_hash(), top_height);
printer.set_stat(printer::Stat::HeaderCount(top_height));
if top_height >= starting_height as u64 {
- scan_net();
+ if !SCANNING.swap(true, Ordering::SeqCst) {
+ scan_net();
+ }
}
} else {
// Wat? Lets start again...