Files
atomic-swap/rpcclient/peers.go
2023-05-20 16:29:42 -05:00

24 lines
477 B
Go

// Copyright 2023 The AthanorLabs/atomic-swap Authors
// SPDX-License-Identifier: LGPL-3.0-only
package rpcclient
import (
"github.com/athanorlabs/atomic-swap/common/rpctypes"
)
// Peers calls net_peers to get the connected peers of a swapd instance.
func (c *Client) Peers() (*rpctypes.PeersResponse, error) {
const (
method = "net_peers"
)
res := &rpctypes.PeersResponse{}
if err := c.post(method, nil, res); err != nil {
return nil, err
}
return res, nil
}