commit
5d4925d582
@ -570,9 +570,9 @@ impl BlockChain {
|
|||||||
if let BlockLocation::BranchBecomingCanonChain(ref d) = info.location {
|
if let BlockLocation::BranchBecomingCanonChain(ref d) = info.location {
|
||||||
info!(target: "reorg", "Reorg to {} ({} {} {})",
|
info!(target: "reorg", "Reorg to {} ({} {} {})",
|
||||||
Colour::Yellow.bold().paint(format!("#{} {}", info.number, info.hash)),
|
Colour::Yellow.bold().paint(format!("#{} {}", info.number, info.hash)),
|
||||||
Colour::Red.paint(d.retracted.iter().fold(String::new(), |acc, h| format!("{} {}", acc, h))),
|
Colour::Red.paint(d.retracted.iter().join(" ")),
|
||||||
Colour::White.paint(format!("#{} {}", d.ancestor, self.block_details(&d.ancestor).expect("`ancestor` is in the route; qed").number)),
|
Colour::White.paint(format!("#{} {}", self.block_details(&d.ancestor).expect("`ancestor` is in the route; qed").number, d.ancestor)),
|
||||||
Colour::Green.paint(d.enacted.iter().fold(String::new(), |acc, h| format!("{} {}", acc, h)))
|
Colour::Green.paint(d.enacted.iter().join(" "))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@ Operating Options:
|
|||||||
[default: 3600].
|
[default: 3600].
|
||||||
--chain CHAIN Specify the blockchain type. CHAIN may be either a
|
--chain CHAIN Specify the blockchain type. CHAIN may be either a
|
||||||
JSON chain specification file or olympic, frontier,
|
JSON chain specification file or olympic, frontier,
|
||||||
homestead, mainnet, morden, homestead-dogmatic, or
|
homestead, mainnet, morden, classic or testnet
|
||||||
testnet [default: homestead].
|
[default: homestead].
|
||||||
-d --db-path PATH Specify the database & configuration directory path
|
-d --db-path PATH Specify the database & configuration directory path
|
||||||
[default: $HOME/.parity].
|
[default: $HOME/.parity].
|
||||||
--keys-path PATH Specify the path for JSON key files to be found
|
--keys-path PATH Specify the path for JSON key files to be found
|
||||||
|
@ -350,11 +350,11 @@ impl Configuration {
|
|||||||
let mut buffer = String::new();
|
let mut buffer = String::new();
|
||||||
let mut node_file = try!(File::open(path).map_err(|e| format!("Error opening reserved nodes file: {}", e)));
|
let mut node_file = try!(File::open(path).map_err(|e| format!("Error opening reserved nodes file: {}", e)));
|
||||||
try!(node_file.read_to_string(&mut buffer).map_err(|_| "Error reading reserved node file"));
|
try!(node_file.read_to_string(&mut buffer).map_err(|_| "Error reading reserved node file"));
|
||||||
if let Some(invalid) = buffer.lines().find(|s| !is_valid_node_url(s)) {
|
let lines = buffer.lines().map(|s| s.trim().to_owned()).filter(|s| s.len() > 0).collect::<Vec<_>>();
|
||||||
Err(format!("Invalid node address format given for a boot node: {}", invalid))
|
if let Some(invalid) = lines.iter().find(|s| !is_valid_node_url(s)) {
|
||||||
} else {
|
return Err(format!("Invalid node address format given for a boot node: {}", invalid));
|
||||||
Ok(buffer.lines().map(|s| s.to_owned()).collect())
|
|
||||||
}
|
}
|
||||||
|
Ok(lines)
|
||||||
},
|
},
|
||||||
None => Ok(Vec::new())
|
None => Ok(Vec::new())
|
||||||
}
|
}
|
||||||
@ -538,6 +538,9 @@ mod tests {
|
|||||||
use blockchain::{BlockchainCmd, ImportBlockchain, ExportBlockchain};
|
use blockchain::{BlockchainCmd, ImportBlockchain, ExportBlockchain};
|
||||||
use presale::ImportWallet;
|
use presale::ImportWallet;
|
||||||
use account::{AccountCmd, NewAccount, ImportAccounts};
|
use account::{AccountCmd, NewAccount, ImportAccounts};
|
||||||
|
use devtools::{RandomTempPath};
|
||||||
|
use std::io::Write;
|
||||||
|
use std::fs::{File, create_dir};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
struct TestPasswordReader(&'static str);
|
struct TestPasswordReader(&'static str);
|
||||||
@ -769,5 +772,16 @@ mod tests {
|
|||||||
// then
|
// then
|
||||||
assert_eq!(conf0.signer_enabled(), false);
|
assert_eq!(conf0.signer_enabled(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn should_not_bail_on_empty_line_in_reserved_peers() {
|
||||||
|
let temp = RandomTempPath::new();
|
||||||
|
create_dir(temp.as_str().to_owned()).unwrap();
|
||||||
|
let filename = temp.as_str().to_owned() + "/peers";
|
||||||
|
File::create(filename.clone()).unwrap().write_all(b" \n\t\n").unwrap();
|
||||||
|
let args = vec!["parity", "--reserved-peers", &filename];
|
||||||
|
let conf = Configuration::parse(args).unwrap();
|
||||||
|
assert!(conf.init_reserved_nodes().is_ok());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
extern crate docopt;
|
extern crate docopt;
|
||||||
extern crate num_cpus;
|
extern crate num_cpus;
|
||||||
extern crate rustc_serialize;
|
extern crate rustc_serialize;
|
||||||
|
extern crate ethcore_devtools as devtools;
|
||||||
|
#[macro_use]
|
||||||
extern crate ethcore_util as util;
|
extern crate ethcore_util as util;
|
||||||
extern crate ethcore;
|
extern crate ethcore;
|
||||||
extern crate ethsync;
|
extern crate ethsync;
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
use std::sync::{Arc, Mutex, Condvar};
|
use std::sync::{Arc, Mutex, Condvar};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
use std::io::ErrorKind;
|
||||||
use ctrlc::CtrlC;
|
use ctrlc::CtrlC;
|
||||||
use fdlimit::raise_fd_limit;
|
use fdlimit::raise_fd_limit;
|
||||||
use ethcore_logger::{Config as LogConfig, setup_log};
|
use ethcore_logger::{Config as LogConfig, setup_log};
|
||||||
@ -283,6 +284,7 @@ fn daemonize(_pid_file: String) -> Result<(), String> {
|
|||||||
fn prepare_account_provider(dirs: &Directories, cfg: AccountsConfig) -> Result<AccountProvider, String> {
|
fn prepare_account_provider(dirs: &Directories, cfg: AccountsConfig) -> Result<AccountProvider, String> {
|
||||||
use ethcore::ethstore::{import_accounts, EthStore};
|
use ethcore::ethstore::{import_accounts, EthStore};
|
||||||
use ethcore::ethstore::dir::{GethDirectory, DirectoryType, DiskDirectory};
|
use ethcore::ethstore::dir::{GethDirectory, DirectoryType, DiskDirectory};
|
||||||
|
use ethcore::ethstore::Error;
|
||||||
|
|
||||||
let passwords = try!(passwords_from_files(cfg.password_files));
|
let passwords = try!(passwords_from_files(cfg.password_files));
|
||||||
|
|
||||||
@ -295,8 +297,10 @@ fn prepare_account_provider(dirs: &Directories, cfg: AccountsConfig) -> Result<A
|
|||||||
|
|
||||||
let from = GethDirectory::open(t);
|
let from = GethDirectory::open(t);
|
||||||
let to = DiskDirectory::create(dirs.keys.clone()).unwrap();
|
let to = DiskDirectory::create(dirs.keys.clone()).unwrap();
|
||||||
if let Err(err) = import_accounts(&from, &to) {
|
match import_accounts(&from, &to) {
|
||||||
warn!("Import geth accounts failed. {}", err);
|
Ok(_) => {}
|
||||||
|
Err(Error::Io(ref io_err)) if io_err.kind() == ErrorKind::NotFound => {}
|
||||||
|
Err(err) => warn!("Import geth accounts failed. {}", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user