nodeLocked returns the current best node information. u.L must be held.
()
| 114 | |
| 115 | // nodeLocked returns the current best node information. u.L must be held. |
| 116 | func (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. |
no test coverage detected