mirror of https://github.com/status-im/go-waku.git
fix: get_waku_v2_admin_v1_peers response
This commit is contained in:
parent
ecf55b6f89
commit
069d66ed6d
|
@ -26,14 +26,12 @@ type PeersArgs struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type PeerReply struct {
|
type PeerReply struct {
|
||||||
Multiaddr string `json:"mutliaddr,omitempty"`
|
Multiaddr string `json:"multiaddr,omitempty"`
|
||||||
Protocol string `json:"protocol,omitempty"`
|
Protocol string `json:"protocol,omitempty"`
|
||||||
Connected bool `json:"connected,omitempty"`
|
Connected bool `json:"connected,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PeersReply struct {
|
type PeersReply []PeerReply
|
||||||
Peers []PeerReply `json:"peers,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *AdminService) PostV1Peers(req *http.Request, args *PeersArgs, reply *SuccessReply) error {
|
func (a *AdminService) PostV1Peers(req *http.Request, args *PeersArgs, reply *SuccessReply) error {
|
||||||
for _, peer := range args.Peers {
|
for _, peer := range args.Peers {
|
||||||
|
@ -70,7 +68,7 @@ func (a *AdminService) GetV1Peers(req *http.Request, args *GetPeersArgs, reply *
|
||||||
if !isWakuProtocol(proto) {
|
if !isWakuProtocol(proto) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
reply.Peers = append(reply.Peers, PeerReply{
|
*reply = append(*reply, PeerReply{
|
||||||
Multiaddr: addr.String(),
|
Multiaddr: addr.String(),
|
||||||
Protocol: proto,
|
Protocol: proto,
|
||||||
Connected: peer.Connected,
|
Connected: peer.Connected,
|
||||||
|
|
Loading…
Reference in New Issue