From 91798846720221a329d5ca7c26998fc7cb2b140e Mon Sep 17 00:00:00 2001 From: Sagleft Date: Wed, 30 Nov 2022 22:42:39 +0200 Subject: [PATCH] add peer info container --- v2/internal/utopia/client.go | 4 ++-- v2/pkg/structs/structs.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/v2/internal/utopia/client.go b/v2/internal/utopia/client.go index 38bfa3d..02bb4c8 100644 --- a/v2/internal/utopia/client.go +++ b/v2/internal/utopia/client.go @@ -432,10 +432,10 @@ func (c *UtopiaClient) GetNetworkConnections() ([]structs.PeerInfo, error) { return nil, err } - data := []structs.PeerInfo{} + data := structs.PeersInfoContainer{} if err := convertResult(response, &data); err != nil { return nil, err } - return data, nil + return data.Connections, nil } diff --git a/v2/pkg/structs/structs.go b/v2/pkg/structs/structs.go index b6d4391..fdb56c2 100644 --- a/v2/pkg/structs/structs.go +++ b/v2/pkg/structs/structs.go @@ -110,6 +110,10 @@ type SearchChannelData struct { OwnerPubkey string `json:"owner"` // 1B742E8D8DAE682ADD2568BE25B23F35BA7A8BFC1D5D3BCA0EE219A754A48201 } +type PeersInfoContainer struct { + Connections []PeerInfo `json:"connections"` +} + type PeerInfo struct { Direction int `json:"direction"` Address string `json:"remoteAddress"`