Skip to content

Commit

Permalink
dcrlnd: fix config panic (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
dajohi authored Sep 20, 2023
1 parent c97f63c commit 944b0fc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,

s.controlTower = routing.NewControlTower(paymentControl)

s.chanRouter, err = routing.New(routing.Config{
routingCfg := routing.Config{
Graph: chanGraph,
Chain: cc.ChainIO,
ChainView: cc.ChainView,
Expand All @@ -775,11 +775,14 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
ChannelPruneExpiry: routing.DefaultChannelPruneExpiry,
GraphPruneInterval: time.Hour,
QueryBandwidth: queryBandwidth,
AssumeChannelValid: cfg.Routing.AssumeChannelValid,
NextPaymentID: sequencer.NextID,
PathFindingConfig: pathFindingConfig,
Clock: clock.NewDefaultClock(),
})
}
if cfg.Routing != nil {
routingCfg.AssumeChannelValid = cfg.Routing.AssumeChannelValid
}
s.chanRouter, err = routing.New(routingCfg)
if err != nil {
return nil, fmt.Errorf("can't create router: %v", err)
}
Expand Down

0 comments on commit 944b0fc

Please sign in to comment.