Browse Source

set NodeInfo on switch before starting RPC server

should fix #1199
pull/1511/head
Ethan Buchman 6 years ago
parent
commit
593a785ae2
1 changed files with 10 additions and 10 deletions
  1. +10
    -10
      node/node.go

+ 10
- 10
node/node.go View File

@ -382,16 +382,6 @@ func (n *Node) OnStart() error {
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
protocol, address := cmn.ProtocolAndAddress(n.config.P2P.ListenAddress)
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
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
err = n.sw.Start()
if err != nil {


Loading…
Cancel
Save