Changed origin block index to 1. Added "locker" blocks - mining, exchange etc. Removed unnecesarry creation of 'zones' directory on startup. Changed bind port of DNS-UDP socket to random (fixes inability to start several copies of Alfis). Sped up block exchange by sending additional pings when we have more blocks than other peers. Fixed unnecesarry double requests of blocks. Totally reworked block checking on arrival. Added target tags for logging in main. Added a commandline flag to list all blocks in DB and exit.
This commit is contained in:
+1
-5
@@ -1,6 +1,5 @@
|
||||
//! The `ServerContext in this thread holds the common state across the server
|
||||
|
||||
use std::fs;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -70,7 +69,7 @@ impl ServerContext {
|
||||
authority: Authority::new(),
|
||||
cache: SynchronizedCache::new(),
|
||||
filters: Vec::new(),
|
||||
client: Box::new(DnsNetworkClient::new(34255)),
|
||||
client: Box::new(DnsNetworkClient::new(10000 + (rand::random::<u16>() % 20000))),
|
||||
dns_host: String::from("0.0.0.0"),
|
||||
dns_port: 53,
|
||||
api_port: 5380,
|
||||
@@ -88,9 +87,6 @@ impl ServerContext {
|
||||
}
|
||||
|
||||
pub fn initialize(&mut self) -> Result<()> {
|
||||
// Create zones directory if it doesn't exist
|
||||
fs::create_dir_all(self.zones_dir)?;
|
||||
|
||||
// Start UDP client thread
|
||||
self.client.run()?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user