start peer before AddPeer() on reactors.

This commit is contained in:
Jae Kwon
2015-03-25 13:22:46 -07:00
parent a2b8318aac
commit bd6d9d646d
2 changed files with 5 additions and 5 deletions

View File

@@ -225,8 +225,8 @@ func (conR *ConsensusReactor) SetPrivValidator(priv *sm.PrivValidator) {
conR.conS.SetPrivValidator(priv)
}
// Fast forward to some state.
func (conR *ConsensusReactor) UpdateToState(state *sm.State) {
// Reset to some state.
func (conR *ConsensusReactor) ResetToState(state *sm.State) {
conR.conS.updateToState(state, false)
}

View File

@@ -131,12 +131,12 @@ func (sw *Switch) AddPeerWithConnection(conn net.Conn, outbound bool) (*Peer, er
return nil, ErrSwitchDuplicatePeer
}
// Notify listeners.
sw.doAddPeer(peer)
// Start the peer
go peer.start()
// Notify listeners.
sw.doAddPeer(peer)
// Send handshake
msg := &pexHandshakeMessage{Network: sw.network}
peer.Send(PexChannel, msg)