From a5e5127365a1d6b2c9c46148733fd85d0af912fa Mon Sep 17 00:00:00 2001 From: ylsGit Date: Fri, 26 Jul 2024 14:56:02 +0800 Subject: [PATCH] hide ip (#3320) --- libs/tendermint/rpc/core/net.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/tendermint/rpc/core/net.go b/libs/tendermint/rpc/core/net.go index 9b1ff8b7a2..d5453b4d2a 100644 --- a/libs/tendermint/rpc/core/net.go +++ b/libs/tendermint/rpc/core/net.go @@ -20,11 +20,13 @@ func NetInfo(ctx *rpctypes.Context) (*ctypes.ResultNetInfo, error) { if !ok { return nil, fmt.Errorf("peer.NodeInfo() is not DefaultNodeInfo") } + nodeInfo.ListenAddr = "" + nodeInfo.Other.RPCAddress = "" peers = append(peers, ctypes.Peer{ NodeInfo: nodeInfo, IsOutbound: peer.IsOutbound(), ConnectionStatus: peer.Status(), - RemoteIP: peer.RemoteIP().String(), + RemoteIP: "", }) } // TODO: Should we include PersistentPeers and Seeds in here? @@ -32,7 +34,7 @@ func NetInfo(ctx *rpctypes.Context) (*ctypes.ResultNetInfo, error) { // CON: privacy return &ctypes.ResultNetInfo{ Listening: env.P2PTransport.IsListening(), - Listeners: env.P2PTransport.Listeners(), + Listeners: []string{""}, NPeers: len(peers), Peers: peers, }, nil