Skip to content

Commit

Permalink
Abort when -l is not present or unreadable
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Jun 16, 2018
1 parent f6e7077 commit 92599ac
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/bin/fullnode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ fn main() {

eprintln!("creating networking stack...");

let exit = Arc::new(AtomicBool::new(false));
let bind_addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), 8000);
let mut repl_data = ReplicatedData::new_leader(&bind_addr);
if matches.opt_present("l") {
Expand All @@ -115,13 +114,16 @@ fn main() {
if let Ok(data) = serde_json::from_reader(file) {
repl_data = data;
} else {
warn!("failed to parse {}, generating new identity", path);
eprintln!("failed to parse {}", path);
exit(1);
}
} else {
warn!("failed to read {}, generating new identity", path);
eprintln!("failed to read {}", path);
exit(1);
}
}

let exit = Arc::new(AtomicBool::new(false));
let threads = if matches.opt_present("v") {
let path = matches.opt_str("v").unwrap();
eprintln!(
Expand Down

0 comments on commit 92599ac

Please sign in to comment.