From 95c218355e9c4bf4cd90f4ff381b1c98587a9c3a Mon Sep 17 00:00:00 2001 From: Matthew Slipper Date: Thu, 23 May 2019 18:27:35 -0700 Subject: [PATCH] Support multiple bootnodes --- beacon_node/client/src/client_config.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/beacon_node/client/src/client_config.rs b/beacon_node/client/src/client_config.rs index 8d7176c2c..f42336a54 100644 --- a/beacon_node/client/src/client_config.rs +++ b/beacon_node/client/src/client_config.rs @@ -95,13 +95,15 @@ impl ClientConfig { } // Custom bootnodes - // TODO: Handle list of addresses if let Some(boot_addresses_str) = args.value_of("boot-nodes") { - if let Ok(boot_address) = boot_addresses_str.parse::() { - config.net_conf.boot_nodes.append(&mut vec![boot_address]); - } else { - error!(log, "Invalid Bootnode multiaddress"; "Multiaddr" => boot_addresses_str); - return Err("Invalid IP Address"); + let mut boot_addresses_split = boot_addresses_str.split(","); + for boot_address in boot_addresses_split { + if let Ok(boot_address) = boot_address.parse::() { + config.net_conf.boot_nodes.append(&mut vec![boot_address]); + } else { + error!(log, "Invalid Bootnode multiaddress"; "Multiaddr" => boot_addresses_str); + return Err("Invalid IP Address"); + } } }