[viewchange] protect view change struct during reset

This is a further fix of the following issue.
https://github.com/harmony-one/harmony/issues/3557

Signed-off-by: Leo Chen <leo@harmony.one>
pull/3569/head
Leo Chen 4 years ago
parent e08c2ce41e
commit db453f28d7
  1. 3
      consensus/consensus_service.go

@ -101,7 +101,10 @@ func (consensus *Consensus) UpdatePublicKeys(pubKeys []bls_cosi.PublicKeyWrapper
consensus.UpdateBitmaps() consensus.UpdateBitmaps()
consensus.ResetState() consensus.ResetState()
// do not reset view change state if it is in view changing mode
if !consensus.IsViewChangingMode() {
consensus.ResetViewChangeState() consensus.ResetViewChangeState()
}
return consensus.Decider.ParticipantsCount() return consensus.Decider.ParticipantsCount()
} }

Loading…
Cancel
Save