Throw an error if a bootnode is registered with two different peer ids (#3891)

* Throw an error if a bootnode is registered with two different peer ids

* Rename error

* Fix compilation :(

* Review feedback
This commit is contained in:
Bastian Köcher
2019-10-23 17:17:12 +02:00
committed by GitHub
parent 968b24d849
commit d82216673c
7 changed files with 73 additions and 34 deletions
+3 -3
View File
@@ -172,15 +172,15 @@ pub fn run<I, T, E>(args: I, exit: E, version: cli::VersionInfo) -> error::Resul
match config.roles {
ServiceRoles::LIGHT => run_until_exit(
runtime,
service::new_light(config).map_err(|e| format!("{:?}", e))?,
service::new_light(config)?,
exit
),
_ => run_until_exit(
runtime,
service::new_full(config).map_err(|e| format!("{:?}", e))?,
service::new_full(config)?,
exit
),
}.map_err(|e| format!("{:?}", e))
}
}),
ParseAndPrepare::BuildSpec(cmd) => cmd.run(load_spec),
ParseAndPrepare::ExportBlocks(cmd) => cmd.run_with_builder(|config: Config<_, _>|
+2 -5
View File
@@ -43,7 +43,7 @@ impl cli::IntoExit for Exit {
}
}
fn main() {
fn main() -> Result<(), cli::error::Error> {
let version = VersionInfo {
name: "Substrate Node",
commit: env!("VERGEN_SHA_SHORT"),
@@ -54,8 +54,5 @@ fn main() {
support_url: "https://github.com/paritytech/substrate/issues/new",
};
if let Err(e) = cli::run(::std::env::args(), Exit, version) {
eprintln!("Fatal error: {}\n\n{:?}", e, e);
std::process::exit(1)
}
cli::run(std::env::args(), Exit, version)
}