mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-15 14:21:22 +00:00
20
node/node.go
20
node/node.go
@ -382,16 +382,6 @@ func (n *Node) OnStart() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run the RPC server first
|
|
||||||
// so we can eg. receive txs for the first block
|
|
||||||
if n.config.RPC.ListenAddress != "" {
|
|
||||||
listeners, err := n.startRPC()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
n.rpcListeners = listeners
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create & add listener
|
// Create & add listener
|
||||||
protocol, address := cmn.ProtocolAndAddress(n.config.P2P.ListenAddress)
|
protocol, address := cmn.ProtocolAndAddress(n.config.P2P.ListenAddress)
|
||||||
l := p2p.NewDefaultListener(protocol, address, n.config.P2P.SkipUPNP, n.Logger.With("module", "p2p"))
|
l := p2p.NewDefaultListener(protocol, address, n.config.P2P.SkipUPNP, n.Logger.With("module", "p2p"))
|
||||||
@ -412,6 +402,16 @@ func (n *Node) OnStart() error {
|
|||||||
// Add ourselves to addrbook to prevent dialing ourselves
|
// Add ourselves to addrbook to prevent dialing ourselves
|
||||||
n.addrBook.AddOurAddress(nodeInfo.NetAddress())
|
n.addrBook.AddOurAddress(nodeInfo.NetAddress())
|
||||||
|
|
||||||
|
// Run the RPC server first
|
||||||
|
// so we can eg. receive txs for the first block
|
||||||
|
if n.config.RPC.ListenAddress != "" {
|
||||||
|
listeners, err := n.startRPC()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
n.rpcListeners = listeners
|
||||||
|
}
|
||||||
|
|
||||||
// Start the switch
|
// Start the switch
|
||||||
err = n.sw.Start()
|
err = n.sw.Start()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user