We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75b2f0d commit 7131afeCopy full SHA for 7131afe
tailnet/conn.go
@@ -364,12 +364,15 @@ func (c *Conn) RemoveAllPeers() error {
364
}
365
366
// UpdateNodes connects with a set of peers. This can be constantly updated,
367
-// and peers will continually be reconnected as necessary.
368
-func (c *Conn) UpdateNodes(nodes []*Node, replace bool) error {
+// and peers will continually be reconnected as necessary. If replacePeers is
+// true, all peers will be removed before adding the new ones.
369
+//
370
+//nolint:revive // Complains about replacePeers.
371
+func (c *Conn) UpdateNodes(nodes []*Node, replacePeers bool) error {
372
c.mutex.Lock()
373
defer c.mutex.Unlock()
374
status := c.Status()
- if replace {
375
+ if replacePeers {
376
c.netMap.Peers = []*tailcfg.Node{}
377
c.peerMap = map[tailcfg.NodeID]*tailcfg.Node{}
378
0 commit comments