routing: fix vet error, ensure wait group in topologyClient isn't copied
This commit is contained in:
parent
5c45d52ab6
commit
9b9f419e51
@ -121,7 +121,7 @@ func (r *ChannelRouter) notifyTopologyChange(topologyDiff *TopologyChange) {
|
|||||||
for _, client := range r.topologyClients {
|
for _, client := range r.topologyClients {
|
||||||
client.wg.Add(1)
|
client.wg.Add(1)
|
||||||
|
|
||||||
go func(c topologyClient) {
|
go func(c *topologyClient) {
|
||||||
defer c.wg.Done()
|
defer c.wg.Done()
|
||||||
|
|
||||||
select {
|
select {
|
||||||
|
@ -181,7 +181,7 @@ type ChannelRouter struct {
|
|||||||
// topologyClients maps a client's unique notification ID to a
|
// topologyClients maps a client's unique notification ID to a
|
||||||
// topologyClient client that contains its notification dispatch
|
// topologyClient client that contains its notification dispatch
|
||||||
// channel.
|
// channel.
|
||||||
topologyClients map[uint64]topologyClient
|
topologyClients map[uint64]*topologyClient
|
||||||
|
|
||||||
// ntfnClientUpdates is a channel that's used to send new updates to
|
// ntfnClientUpdates is a channel that's used to send new updates to
|
||||||
// topology notification clients to the ChannelRouter. Updates either
|
// topology notification clients to the ChannelRouter. Updates either
|
||||||
@ -213,7 +213,7 @@ func New(cfg Config) (*ChannelRouter, error) {
|
|||||||
cfg: &cfg,
|
cfg: &cfg,
|
||||||
selfNode: selfNode,
|
selfNode: selfNode,
|
||||||
networkUpdates: make(chan *routingMsg),
|
networkUpdates: make(chan *routingMsg),
|
||||||
topologyClients: make(map[uint64]topologyClient),
|
topologyClients: make(map[uint64]*topologyClient),
|
||||||
ntfnClientUpdates: make(chan *topologyClientUpdate),
|
ntfnClientUpdates: make(chan *topologyClientUpdate),
|
||||||
routeCache: make(map[routeTuple][]*Route),
|
routeCache: make(map[routeTuple][]*Route),
|
||||||
quit: make(chan struct{}),
|
quit: make(chan struct{}),
|
||||||
@ -499,7 +499,7 @@ func (r *ChannelRouter) networkHandler() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
r.topologyClients[ntfnUpdate.clientID] = topologyClient{
|
r.topologyClients[ntfnUpdate.clientID] = &topologyClient{
|
||||||
ntfnChan: ntfnUpdate.ntfnChan,
|
ntfnChan: ntfnUpdate.ntfnChan,
|
||||||
exit: make(chan struct{}),
|
exit: make(chan struct{}),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user