Removed deadcode, LockedFBFTPhase.

pull/4509/head
frozen 2 years ago committed by Casey Gardiner
parent eb6c946fe1
commit 3af8a96cb3
  1. 2
      consensus/consensus_service.go
  2. 15
      consensus/consensus_v2.go

@ -554,7 +554,7 @@ func (consensus *Consensus) switchPhase(subject string, desired FBFTPhase) {
Str("to:", desired.String()).
Str("switchPhase:", subject)
consensus.phase.Set(desired)
consensus.phase = desired
}
var (

@ -450,21 +450,6 @@ func (consensus *Consensus) BlockChannel(newBlock *types.Block) {
}
}
// waitForCommit wait extra 2 seconds for commit phase to finish
func (consensus *Consensus) waitForCommit() {
if consensus.mode() != Normal || consensus.phase.Get() != FBFTCommit {
return
}
// We only need to wait consensus is in normal commit phase
utils.Logger().Warn().Str("phase", consensus.phase.String()).Msg("[shutdown] commit phase has to wait")
maxWait := time.Now().Add(2 * consensus.BlockPeriod)
for time.Now().Before(maxWait) && consensus.getConsensusPhase() == "Commit" {
utils.Logger().Warn().Msg("[shutdown] wait for consensus finished")
time.Sleep(time.Millisecond * 100)
}
}
// LastMileBlockIter is the iterator to iterate over the last mile blocks in consensus cache.
// All blocks returned are guaranteed to pass the verification.
type LastMileBlockIter struct {

Loading…
Cancel
Save