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),
} else {
assert!(state_lock.fail_reason != AddressState::Good);
let old_state = store.set_node_state(node, state_lock.fail_reason, 0);
- if old_state != state_lock.fail_reason && state_lock.msg.0 != "" {
+ if old_state != state_lock.fail_reason && state_lock.msg.0 != "" && state_lock.msg.1 {
printer.add_line(format!("Updating {} from {} to {}", node, old_state.to_str(), &state_lock.msg.0), state_lock.msg.1);
}
}
= (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...