Allow testnet dir without boot nodes

This commit is contained in:
Paul Hauner
2019-11-29 08:39:11 +11:00
parent 32a299234f
commit 2fef24d40c

View File

@@ -350,11 +350,12 @@ fn init_new_client<E: EthSpec>(
.deposit_contract_deploy_block
.saturating_sub(client_config.eth1.follow_distance * 2);
client_config.network.boot_nodes = eth2_testnet_dir
.boot_enr
.as_ref()
.ok_or_else(|| "Testnet directory does not contain any boot nodes")?
.clone();
if let Some(boot_nodes) = eth2_testnet_dir.boot_enr {
client_config
.network
.boot_nodes
.append(&mut boot_nodes.clone())
}
if let Some(genesis_state) = eth2_testnet_dir.genesis_state {
// Note: re-serializing the genesis state is not so efficient, however it avoids adding