Skip to content

Commit

Permalink
Stop trying to resolve empty initial peer lists
Browse files Browse the repository at this point in the history
Instead, log an error and return immediately.
  • Loading branch information
teor2345 committed May 17, 2021
1 parent b600e82 commit 679920f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions zebra-network/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ impl Config {
async fn resolve_peers(peers: &HashSet<String>) -> HashSet<SocketAddr> {
use futures::stream::StreamExt;

if peers.is_empty() {
error!("no initial peers in the network config. Hint: you must configure at least one peer or DNS seeder to run Zebra");
return HashSet::new();
}

loop {
// We retry each peer individually, as well as retrying if there are
// no peers in the combined list. DNS failures are correlated, so all
Expand Down

0 comments on commit 679920f

Please sign in to comment.