Skip to content

Commit

Permalink
Fix panic (initialize rgs map in constructor)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkren committed Nov 25, 2019
1 parent 5fdd937 commit 856d078
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func New(n *snet.Network, config *Config) (Router, error) {
rt: config.RoutingTable,
sl: sl,
rfc: config.RouteFinder,
rgs: make(map[routing.RouteDescriptor]*RouteGroup),
rpcSrv: rpc.NewServer(),
accept: make(chan routing.EdgeRules, acceptSize),
trustedNodes: trustedNodes,
Expand Down Expand Up @@ -491,7 +492,7 @@ func (r *router) SaveRoutingRules(rules ...routing.Rule) error {
}

func (r *router) ReserveKeys(n int) ([]routing.RouteID, error) {
ids, err := r.rt.ReserveKeys(n)
ids, err := r.rt.ReserveKeys(n)
if err != nil {
r.logger.WithError(err).Error("Error reserving IDs")
}
Expand Down

0 comments on commit 856d078

Please sign in to comment.