mirror of
https://github.com/AthanorLabs/atomic-swap.git
synced 2026-01-08 21:58:07 -05:00
24 lines
477 B
Go
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
|
|
}
|