mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-25 10:41:41 +00:00
rpc: add n_peers to /net_info
This commit is contained in:
@ -23,6 +23,7 @@ import (
|
||||
// {
|
||||
// "error": "",
|
||||
// "result": {
|
||||
// "n_peers": 0,
|
||||
// "peers": [],
|
||||
// "listeners": [
|
||||
// "Listener(@10.0.2.15:46656)"
|
||||
@ -47,11 +48,13 @@ func NetInfo() (*ctypes.ResultNetInfo, error) {
|
||||
ConnectionStatus: peer.Status(),
|
||||
})
|
||||
}
|
||||
// TODO: should we include "num_peers" field for convenience ?
|
||||
// Let's also include the PersistentPeers and Seeds in here.
|
||||
// TODO: Should we include PersistentPeers and Seeds in here?
|
||||
// PRO: useful info
|
||||
// CON: privacy
|
||||
return &ctypes.ResultNetInfo{
|
||||
Listening: listening,
|
||||
Listeners: listeners,
|
||||
NPeers: len(peers),
|
||||
Peers: peers,
|
||||
}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user