MCPcopy Index your code
hub / github.com/coder/coder / nodeLocked

Method nodeLocked

tailnet/node.go:116–133  ·  view source on GitHub ↗

nodeLocked returns the current best node information. u.L must be held.

()

Source from the content-addressed store, hash-verified

114
115// nodeLocked returns the current best node information. u.L must be held.
116func (u *nodeUpdater) nodeLocked() *Node {
117 var endpoints []string
118 if !u.blockEndpoints {
119 endpoints = slices.Clone(u.endpoints)
120 }
121 return &Node{
122 ID: u.id,
123 AsOf: dbtime.Now(),
124 Key: u.key,
125 Addresses: slices.Clone(u.addresses),
126 AllowedIPs: slices.Clone(u.addresses),
127 DiscoKey: u.discoKey,
128 Endpoints: endpoints,
129 PreferredDERP: u.preferredDERP,
130 DERPLatency: maps.Clone(u.derpLatency),
131 DERPForcedWebsocket: maps.Clone(u.derpForcedWebsockets),
132 }
133}
134
135// setNetInfo processes a NetInfo update from the wireguard engine. c.L MUST
136// NOT be held.

Callers 2

updateLoopMethod · 0.95
NodeMethod · 0.80

Calls 2

NowFunction · 0.92
CloneMethod · 0.45

Tested by

no test coverage detected