mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-24 02:01:43 +00:00
libs: Remove usage of custom Fmt, in favor of fmt.Sprintf (#2199)
* libs: Remove usage of custom Fmt, in favor of fmt.Sprintf Closes #2193 * Fix bug that was masked by custom Fmt!
This commit is contained in:
18
node/node.go
18
node/node.go
@ -327,7 +327,7 @@ func NewNode(config *cfg.Config,
|
||||
if config.FilterPeers {
|
||||
// NOTE: addr is ip:port
|
||||
sw.SetAddrFilter(func(addr net.Addr) error {
|
||||
resQuery, err := proxyApp.Query().QuerySync(abci.RequestQuery{Path: cmn.Fmt("/p2p/filter/addr/%s", addr.String())})
|
||||
resQuery, err := proxyApp.Query().QuerySync(abci.RequestQuery{Path: fmt.Sprintf("/p2p/filter/addr/%s", addr.String())})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -337,7 +337,7 @@ func NewNode(config *cfg.Config,
|
||||
return nil
|
||||
})
|
||||
sw.SetIDFilter(func(id p2p.ID) error {
|
||||
resQuery, err := proxyApp.Query().QuerySync(abci.RequestQuery{Path: cmn.Fmt("/p2p/filter/id/%s", id)})
|
||||
resQuery, err := proxyApp.Query().QuerySync(abci.RequestQuery{Path: fmt.Sprintf("/p2p/filter/id/%s", id)})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -683,11 +683,11 @@ func (n *Node) makeNodeInfo(nodeID p2p.ID) p2p.NodeInfo {
|
||||
},
|
||||
Moniker: n.config.Moniker,
|
||||
Other: []string{
|
||||
cmn.Fmt("amino_version=%v", amino.Version),
|
||||
cmn.Fmt("p2p_version=%v", p2p.Version),
|
||||
cmn.Fmt("consensus_version=%v", cs.Version),
|
||||
cmn.Fmt("rpc_version=%v/%v", rpc.Version, rpccore.Version),
|
||||
cmn.Fmt("tx_index=%v", txIndexerStatus),
|
||||
fmt.Sprintf("amino_version=%v", amino.Version),
|
||||
fmt.Sprintf("p2p_version=%v", p2p.Version),
|
||||
fmt.Sprintf("consensus_version=%v", cs.Version),
|
||||
fmt.Sprintf("rpc_version=%v/%v", rpc.Version, rpccore.Version),
|
||||
fmt.Sprintf("tx_index=%v", txIndexerStatus),
|
||||
},
|
||||
}
|
||||
|
||||
@ -696,7 +696,7 @@ func (n *Node) makeNodeInfo(nodeID p2p.ID) p2p.NodeInfo {
|
||||
}
|
||||
|
||||
rpcListenAddr := n.config.RPC.ListenAddress
|
||||
nodeInfo.Other = append(nodeInfo.Other, cmn.Fmt("rpc_addr=%v", rpcListenAddr))
|
||||
nodeInfo.Other = append(nodeInfo.Other, fmt.Sprintf("rpc_addr=%v", rpcListenAddr))
|
||||
|
||||
if !n.sw.IsListening() {
|
||||
return nodeInfo
|
||||
@ -705,7 +705,7 @@ func (n *Node) makeNodeInfo(nodeID p2p.ID) p2p.NodeInfo {
|
||||
p2pListener := n.sw.Listeners()[0]
|
||||
p2pHost := p2pListener.ExternalAddressHost()
|
||||
p2pPort := p2pListener.ExternalAddress().Port
|
||||
nodeInfo.ListenAddr = cmn.Fmt("%v:%v", p2pHost, p2pPort)
|
||||
nodeInfo.ListenAddr = fmt.Sprintf("%v:%v", p2pHost, p2pPort)
|
||||
|
||||
return nodeInfo
|
||||
}
|
||||
|
Reference in New Issue
Block a user