(id uuid.UUID, n *proto.Node, k proto.CoordinateResponse_PeerUpdate_Kind, reason string)
| 353 | } |
| 354 | |
| 355 | func (c *core) updateTunnelPeersLocked(id uuid.UUID, n *proto.Node, k proto.CoordinateResponse_PeerUpdate_Kind, reason string) { |
| 356 | tp := c.tunnels.findTunnelPeers(id) |
| 357 | c.logger.Debug(context.Background(), "got tunnel peers", slog.F("peer_id", id), slog.F("tunnel_peers", tp)) |
| 358 | for _, otherID := range tp { |
| 359 | other, ok := c.peers[otherID] |
| 360 | if !ok { |
| 361 | continue |
| 362 | } |
| 363 | err := other.updateMappingLocked(id, n, k, reason) |
| 364 | if err != nil { |
| 365 | other.logger.Error(context.Background(), "failed to update mapping", slog.Error(err)) |
| 366 | c.removePeerLocked(other.id, proto.CoordinateResponse_PeerUpdate_DISCONNECTED, "failed update", "failed to update tunnel peer mapping") |
| 367 | } |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | func (c *core) addTunnelLocked(src *peer, dstID uuid.UUID) error { |
| 372 | c.tunnels.add(src.id, dstID) |
no test coverage detected