Browse Source

start peer before AddPeer() on reactors.

pull/43/merge
Jae Kwon 10 years ago
parent
commit
bd6d9d646d
2 changed files with 5 additions and 5 deletions
  1. +2
    -2
      consensus/reactor.go
  2. +3
    -3
      p2p/switch.go

+ 2
- 2
consensus/reactor.go 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)
}


+ 3
- 3
p2p/switch.go 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)


Loading…
Cancel
Save