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 {
|
||||
Multiaddr string `json:"mutliaddr,omitempty"`
|
||||
Multiaddr string `json:"multiaddr,omitempty"`
|
||||
Protocol string `json:"protocol,omitempty"`
|
||||
Connected bool `json:"connected,omitempty"`
|
||||
}
|
||||
|
||||
type PeersReply struct {
|
||||
Peers []PeerReply `json:"peers,omitempty"`
|
||||
}
|
||||
type PeersReply []PeerReply
|
||||
|
||||
func (a *AdminService) PostV1Peers(req *http.Request, args *PeersArgs, reply *SuccessReply) error {
|
||||
for _, peer := range args.Peers {
|
||||
|
@ -70,7 +68,7 @@ func (a *AdminService) GetV1Peers(req *http.Request, args *GetPeersArgs, reply *
|
|||
if !isWakuProtocol(proto) {
|
||||
continue
|
||||
}
|
||||
reply.Peers = append(reply.Peers, PeerReply{
|
||||
*reply = append(*reply, PeerReply{
|
||||
Multiaddr: addr.String(),
|
||||
Protocol: proto,
|
||||
Connected: peer.Connected,
|
||||
|
|
Loading…
Reference in New Issue