}
printer.add_line(format!("Added {} new addresses from other DNS seeds", new_addrs), false);
Delay::new(Instant::now() + Duration::from_secs(60)).then(|_| {
- if !START_SHUTDOWN.load(Ordering::Relaxed) {
- poll_dnsseeds();
- }
- future::ok(())
+ let store = unsafe { DATA_STORE.as_ref().unwrap() };
+ store.save_data().then(|_| {
+ if !START_SHUTDOWN.load(Ordering::Relaxed) {
+ poll_dnsseeds();
+ }
+ future::ok(())
+ })
})
}));
}
scan_node(iter_time, node, false);
iter_time += per_iter_time;
}
- Delay::new(cmp::max(iter_time, start_time + Duration::from_secs(15))).then(|_| {
- let store = unsafe { DATA_STORE.as_ref().unwrap() };
- store.save_data().then(|_| {
- if !START_SHUTDOWN.load(Ordering::Relaxed) {
- scan_net();
- }
- future::ok(())
- })
+ Delay::new(cmp::max(iter_time, start_time + Duration::from_secs(1))).then(|_| {
+ if !START_SHUTDOWN.load(Ordering::Relaxed) {
+ scan_net();
+ }
+ future::ok(())
})
}));
}
if top_height >= starting_height as u64 {
if let Err(_) = trusted_write.try_send(NetworkMessage::GetData(vec![Inventory {
inv_type: InvType::WitnessBlock,
- hash: height_map.get(&(top_height - 1008)).unwrap().clone(),
+ hash: height_map.get(&(top_height - 216)).unwrap().clone(),
}])) {
return future::err(());
}
let hash = block.header.bitcoin_hash();
let header_map = unsafe { HEADER_MAP.as_ref().unwrap() }.lock().unwrap();
let height = *header_map.get(&hash).expect("Got loose block from trusted peer we coulnd't have requested");
- if height == unsafe { HIGHEST_HEADER.as_ref().unwrap() }.lock().unwrap().1 - 1008 {
+ if height == unsafe { HIGHEST_HEADER.as_ref().unwrap() }.lock().unwrap().1 - 216 {
*unsafe { REQUEST_BLOCK.as_ref().unwrap() }.lock().unwrap() = Arc::new((height, hash, block));
if !SCANNING.swap(true, Ordering::SeqCst) {
scan_net();