Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abort when -l is not present or unreadable #370

Merged
merged 1 commit into from
Jun 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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