mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-10-14 00:59:33 +00:00
[DEV-238] Remove addrlocal from getPeerInfo RPC call (#117)
This commit is contained in:
parent
8721f0d03f
commit
78e8c6084c
@ -231,7 +231,6 @@ type GetNetworkInfoResult struct {
|
|||||||
type GetPeerInfoResult struct {
|
type GetPeerInfoResult struct {
|
||||||
ID int32 `json:"id"`
|
ID int32 `json:"id"`
|
||||||
Addr string `json:"addr"`
|
Addr string `json:"addr"`
|
||||||
AddrLocal string `json:"addrlocal,omitempty"`
|
|
||||||
Services string `json:"services"`
|
Services string `json:"services"`
|
||||||
RelayTxes bool `json:"relaytxes"`
|
RelayTxes bool `json:"relaytxes"`
|
||||||
LastSend int64 `json:"lastsend"`
|
LastSend int64 `json:"lastsend"`
|
||||||
|
11
peer/peer.go
11
peer/peer.go
@ -713,17 +713,6 @@ func (p *Peer) LastRecv() time.Time {
|
|||||||
return time.Unix(atomic.LoadInt64(&p.lastRecv), 0)
|
return time.Unix(atomic.LoadInt64(&p.lastRecv), 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
// LocalAddr returns the local address of the connection.
|
|
||||||
//
|
|
||||||
// This function is safe fo concurrent access.
|
|
||||||
func (p *Peer) LocalAddr() net.Addr {
|
|
||||||
var localAddr net.Addr
|
|
||||||
if atomic.LoadInt32(&p.connected) != 0 {
|
|
||||||
localAddr = p.conn.LocalAddr()
|
|
||||||
}
|
|
||||||
return localAddr
|
|
||||||
}
|
|
||||||
|
|
||||||
// BytesSent returns the total number of bytes sent by the peer.
|
// BytesSent returns the total number of bytes sent by the peer.
|
||||||
//
|
//
|
||||||
// This function is safe for concurrent access.
|
// This function is safe for concurrent access.
|
||||||
|
@ -2362,7 +2362,6 @@ func handleGetPeerInfo(s *Server, cmd interface{}, closeChan <-chan struct{}) (i
|
|||||||
info := &btcjson.GetPeerInfoResult{
|
info := &btcjson.GetPeerInfoResult{
|
||||||
ID: statsSnap.ID,
|
ID: statsSnap.ID,
|
||||||
Addr: statsSnap.Addr,
|
Addr: statsSnap.Addr,
|
||||||
AddrLocal: p.ToPeer().LocalAddr().String(),
|
|
||||||
Services: fmt.Sprintf("%08d", uint64(statsSnap.Services)),
|
Services: fmt.Sprintf("%08d", uint64(statsSnap.Services)),
|
||||||
RelayTxes: !p.IsTxRelayDisabled(),
|
RelayTxes: !p.IsTxRelayDisabled(),
|
||||||
LastSend: statsSnap.LastSend.Unix(),
|
LastSend: statsSnap.LastSend.Unix(),
|
||||||
|
@ -441,7 +441,6 @@ var helpDescsEnUS = map[string]string{
|
|||||||
// GetPeerInfoResult help.
|
// GetPeerInfoResult help.
|
||||||
"getpeerinforesult-id": "A unique node ID",
|
"getpeerinforesult-id": "A unique node ID",
|
||||||
"getpeerinforesult-addr": "The ip address and port of the peer",
|
"getpeerinforesult-addr": "The ip address and port of the peer",
|
||||||
"getpeerinforesult-addrlocal": "Local address",
|
|
||||||
"getpeerinforesult-services": "Services bitmask which represents the services supported by the peer",
|
"getpeerinforesult-services": "Services bitmask which represents the services supported by the peer",
|
||||||
"getpeerinforesult-relaytxes": "Peer has requested transactions be relayed to it",
|
"getpeerinforesult-relaytxes": "Peer has requested transactions be relayed to it",
|
||||||
"getpeerinforesult-lastsend": "Time the last message was received in seconds since 1 Jan 1970 GMT",
|
"getpeerinforesult-lastsend": "Time the last message was received in seconds since 1 Jan 1970 GMT",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user