Skip to content

Commit 2449837

Browse files
lixmalressys1978
authored andcommitted
[client] Fix status showing P2P without connection (netbirdio#4661)
1 parent 58dfb39 commit 2449837

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

client/status/status.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,15 +205,18 @@ func mapPeers(
205205
localICEEndpoint := ""
206206
remoteICEEndpoint := ""
207207
relayServerAddress := ""
208-
connType := "P2P"
208+
connType := "-"
209209
lastHandshake := time.Time{}
210210
transferReceived := int64(0)
211211
transferSent := int64(0)
212212

213213
isPeerConnected := pbPeerState.ConnStatus == peer.StatusConnected.String()
214214

215-
if pbPeerState.Relayed {
216-
connType = "Relayed"
215+
if isPeerConnected {
216+
connType = "P2P"
217+
if pbPeerState.Relayed {
218+
connType = "Relayed"
219+
}
217220
}
218221

219222
if skipDetailByFilters(pbPeerState, pbPeerState.ConnStatus, statusFilter, prefixNamesFilter, prefixNamesFilterMap, ipsFilter, connectionTypeFilter, connType) {

0 commit comments

Comments
 (0)