Make bootstrapper block til connection established

This commit is contained in:
Paul Hauner
2019-09-04 13:56:30 +10:00
parent 009a7eb9c7
commit 572df4f37e
5 changed files with 44 additions and 11 deletions

View File

@@ -87,7 +87,7 @@ impl<T: BeaconChainTypes> BeaconChainBuilder<T> {
}
pub fn http_bootstrap(server: &str, spec: ChainSpec, log: Logger) -> Result<Self, String> {
let bootstrapper = Bootstrapper::from_server_string(server.to_string())
let bootstrapper = Bootstrapper::connect(server.to_string(), &log)
.map_err(|e| format!("Failed to initialize bootstrap client: {}", e))?;
let (genesis_state, genesis_block) = bootstrapper