Skip to content

Commit

Permalink
Panic if static-nodes.json is wrong (ethereum#260)
Browse files Browse the repository at this point in the history
Earlier, the failures in static-nodes.json would be ignored and then the
node will fail to sync.
Now, with this commit, Geth will fail early if static-nodes.json is
not in the correct format.
  • Loading branch information
ashishb authored Jun 12, 2019
1 parent 4fe652c commit 4689b70
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func (c *Config) parsePersistentNodes(w *bool, path string) []*enode.Node {
// Load the nodes from the config file.
var nodelist []string
if err := common.LoadJSON(path, &nodelist); err != nil {
log.Error(fmt.Sprintf("Can't load node list file: %v", err))
panic(fmt.Sprintf("Can't load node list file: %v", err))
return nil
}
// Interpret the list as a discovery node array
Expand All @@ -378,8 +378,7 @@ func (c *Config) parsePersistentNodes(w *bool, path string) []*enode.Node {
}
node, err := enode.ParseV4(url)
if err != nil {
log.Error(fmt.Sprintf("Node URL %s: %v\n", url, err))
continue
panic(fmt.Sprintf("Node URL %s: %v\n", url, err))
}
nodes = append(nodes, node)
}
Expand Down

0 comments on commit 4689b70

Please sign in to comment.