From 3c4ab9d510649a9899aadb106256218857042da8 Mon Sep 17 00:00:00 2001 From: ylsGit Date: Fri, 26 Jul 2024 14:55:30 +0800 Subject: [PATCH] hide ip (#3319) --- 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