Add sort= option to getPeers (uptime, cost or default if not specified)

Signed-off-by: Neil Alexander <neilalexander@users.noreply.github.com>
This commit is contained in:
Neil Alexander
2025-11-09 23:39:22 +00:00
parent d0b5352db3
commit 306c4c624b
2 changed files with 65 additions and 23 deletions

View File

@@ -164,7 +164,7 @@ func (a *AdminSocket) SetupAdminHandlers() {
},
)
_ = a.AddHandler(
"getPeers", "Show directly connected peers", []string{},
"getPeers", "Show directly connected peers", []string{"sort"},
func(in json.RawMessage) (interface{}, error) {
req := &GetPeersRequest{}
res := &GetPeersResponse{}