Browse Source

broadcast on newStepCh on switch to consensus reactor

pull/67/head
Ethan Buchman 10 years ago
parent
commit
ff87958f95
2 changed files with 2 additions and 1 deletions
  1. +1
    -1
      blockchain/reactor.go
  2. +1
    -0
      consensus/reactor.go

+ 1
- 1
blockchain/reactor.go View File

@ -203,7 +203,7 @@ FOR_LOOP:
maxPending := bcR.pool.numPending == maxPendingRequests
maxPeerless := bcR.pool.peerless == bcR.pool.numPending
o, i, _ := bcR.sw.NumPeers()
enoughPeers := o+i > 5
enoughPeers := o+i >= 5
if maxPending && maxPeerless && enoughPeers {
log.Warn("Time to switch to consensus reactor!", "height", bcR.pool.height)
bcR.pool.Stop()


+ 1
- 0
consensus/reactor.go View File

@ -245,6 +245,7 @@ func (conR *ConsensusReactor) SetPrivValidator(priv *sm.PrivValidator) {
// Reset to some state.
func (conR *ConsensusReactor) ResetToState(state *sm.State) {
conR.conS.updateToState(state, false)
conR.conS.newStepCh <- conR.conS.getRoundState()
}
// implements events.Eventable


Loading…
Cancel
Save