Skip to content

Commit

Permalink
add peer info container
Browse files Browse the repository at this point in the history
  • Loading branch information
Sagleft committed Nov 30, 2022
1 parent 2ad735b commit 9179884
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions v2/internal/utopia/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 4 additions & 0 deletions v2/pkg/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down

0 comments on commit 9179884

Please sign in to comment.