patchifyPeer returns a *tailcfg.PeerChange of the session's existing copy of the n.ID Node to n. It returns ok=false if a patch can't be made, (V, ok) on a delta, or (nil, true) if all the fields were identical (a zero change).
(n *tailcfg.Node, onFalse func(string))
| 960 | // It returns ok=false if a patch can't be made, (V, ok) on a delta, or (nil, |
| 961 | // true) if all the fields were identical (a zero change). |
| 962 | func (ms *mapSession) patchifyPeer(n *tailcfg.Node, onFalse func(string)) (_ *tailcfg.PeerChange, ok bool) { |
| 963 | ms.peersMu.RLock() |
| 964 | defer ms.peersMu.RUnlock() |
| 965 | |
| 966 | was, ok := ms.peers[n.ID] |
| 967 | if !ok { |
| 968 | if onFalse != nil { |
| 969 | onFalse("peer_not_found") |
| 970 | } |
| 971 | return nil, false |
| 972 | } |
| 973 | return peerChangeDiff(was, n, onFalse) |
| 974 | } |
| 975 | |
| 976 | // peerChangeDiff returns the difference from 'was' to 'n', if possible. |
| 977 | // |
no test coverage detected