fix compilation errors

This commit is contained in:
Robert Habermeier 2016-06-19 21:34:02 +02:00
parent 2ea45134ab
commit ab4561b5bc
2 changed files with 7 additions and 3 deletions

View File

@ -157,11 +157,13 @@ impl Configuration {
use std::fs::File;
use std::io::BufRead;
if let Some(ref path) = self.args.reserved_nodes {
let node_file = File::open(path).unwrap_or_else(|e| {
if let Some(ref path) = self.args.flag_reserved_peers {
let mut buffer = String::new();
let mut node_file = File::open(path).unwrap_or_else(|e| {
die!("Error opening reserved nodes file: {}", e);
});
node_file.lines().map(|s| {
node_file.read_to_string(&mut buffer).expect("Error reading reserved node file");
buffer.lines().map(|s| {
Self::normalize_enode(s).unwrap_or_else(|| {
die!("{}: Invalid node address format given for a reserved node.", s);
})

View File

@ -312,6 +312,7 @@ fn execute_export(conf: Configuration) {
boot_nodes: Vec::new(),
use_secret: None,
ideal_peers: 0,
reserved_nodes: Vec::new(),
};
let client_config = conf.client_config(&spec);
@ -383,6 +384,7 @@ fn execute_import(conf: Configuration) {
boot_nodes: Vec::new(),
use_secret: None,
ideal_peers: 0,
reserved_nodes: Vec::new(),
};
let client_config = conf.client_config(&spec);