update cswal test

This commit is contained in:
Ethan Buchman
2017-10-23 10:03:54 -04:00
parent e2e50bc0fc
commit fd60621a8e
8 changed files with 141 additions and 132 deletions

View File

@ -308,6 +308,16 @@ func NewNode(config *cfg.Config,
// OnStart starts the Node. It implements cmn.Service.
func (n *Node) OnStart() error {
// 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"))
@ -330,15 +340,6 @@ func (n *Node) OnStart() error {
}
}
// Run the RPC server
if n.config.RPC.ListenAddress != "" {
listeners, err := n.startRPC()
if err != nil {
return err
}
n.rpcListeners = listeners
}
return nil
}