nodeKeyLocked returns the client's effective node private key, resolving it from the Key field (or generating a fresh one) on first use. c.startMu must be held.
()
| 1438 | // resolving it from the Key field (or generating a fresh one) on |
| 1439 | // first use. c.startMu must be held. |
| 1440 | func (c *Client) nodeKeyLocked() key.NodePrivate { |
| 1441 | if c.key.IsZero() { |
| 1442 | if !c.Key.IsZero() { |
| 1443 | c.key = c.Key |
| 1444 | } else { |
| 1445 | c.key = key.NewNode() |
| 1446 | } |
| 1447 | } |
| 1448 | return c.key |
| 1449 | } |
| 1450 | |
| 1451 | // NewClient returns a client that will connect to the server |
| 1452 | // identified by the given token. It is shorthand for |
no outgoing calls
no test coverage detected