diff --git a/routing/notifications.go b/routing/notifications.go index dd0e24e9..e4d1f648 100644 --- a/routing/notifications.go +++ b/routing/notifications.go @@ -121,7 +121,7 @@ func (r *ChannelRouter) notifyTopologyChange(topologyDiff *TopologyChange) { for _, client := range r.topologyClients { client.wg.Add(1) - go func(c topologyClient) { + go func(c *topologyClient) { defer c.wg.Done() select { diff --git a/routing/router.go b/routing/router.go index 14088d01..25e2b7a1 100644 --- a/routing/router.go +++ b/routing/router.go @@ -181,7 +181,7 @@ type ChannelRouter struct { // topologyClients maps a client's unique notification ID to a // topologyClient client that contains its notification dispatch // channel. - topologyClients map[uint64]topologyClient + topologyClients map[uint64]*topologyClient // ntfnClientUpdates is a channel that's used to send new updates to // topology notification clients to the ChannelRouter. Updates either @@ -213,7 +213,7 @@ func New(cfg Config) (*ChannelRouter, error) { cfg: &cfg, selfNode: selfNode, networkUpdates: make(chan *routingMsg), - topologyClients: make(map[uint64]topologyClient), + topologyClients: make(map[uint64]*topologyClient), ntfnClientUpdates: make(chan *topologyClientUpdate), routeCache: make(map[routeTuple][]*Route), quit: make(chan struct{}), @@ -499,7 +499,7 @@ func (r *ChannelRouter) networkHandler() { continue } - r.topologyClients[ntfnUpdate.clientID] = topologyClient{ + r.topologyClients[ntfnUpdate.clientID] = &topologyClient{ ntfnChan: ntfnUpdate.ntfnChan, exit: make(chan struct{}), }