Make func private.

pull/4509/head
frozen 2 years ago committed by Casey Gardiner
parent 3db9efb8d4
commit d39fb7f5e5
  1. 6
      consensus/consensus_service.go
  2. 2
      consensus/consensus_v2.go
  3. 4
      consensus/view_change.go

@ -94,7 +94,7 @@ func (consensus *Consensus) UpdatePublicKeys(pubKeys, allowlist []bls_cosi.Publi
// reset states after update public keys
// TODO: incorporate bitmaps in the decider, so their state can't be inconsistent.
consensus.UpdateBitmaps()
consensus.ResetState()
consensus.resetState()
// do not reset view change state if it is in view changing mode
if !consensus.isViewChangingMode() {
@ -140,7 +140,7 @@ func (consensus *Consensus) UpdateBitmaps() {
}
// ResetState resets the state of the consensus
func (consensus *Consensus) ResetState() {
func (consensus *Consensus) resetState() {
consensus.switchPhase("ResetState", FBFTAnnounce)
consensus.blockHash = [32]byte{}
@ -520,7 +520,7 @@ func (consensus *Consensus) selfCommit(payload []byte) error {
}
// Have to keep the block hash so the leader can finish the commit phase of prepared block
consensus.ResetState()
consensus.resetState()
copy(consensus.blockHash[:], blockHash[:])
consensus.switchPhase("selfCommit", FBFTCommit)

@ -772,7 +772,7 @@ func (consensus *Consensus) SetupForNewConsensus(blk *types.Block, committedMsg
consensus.SetMode(consensus.UpdateConsensusInformation())
}
consensus.FBFTLog.PruneCacheBeforeBlock(blk.NumberU64())
consensus.ResetState()
consensus.resetState()
}
func (consensus *Consensus) getEpochFirstBlockViewID(epoch *big.Int) (uint64, error) {

@ -338,7 +338,7 @@ func (consensus *Consensus) startNewView(viewID uint64, newLeaderPriKey *bls.Pri
// TODO: consider make ResetState unified and only called in one place like finalizeCommit()
if reset {
consensus.ResetState()
consensus.resetState()
}
consensus.SetLeaderPubKey(newLeaderPriKey.Pub)
@ -554,7 +554,7 @@ func (consensus *Consensus) onNewView(recvMsg *FBFTMessage) {
consensus.sendCommitMessages(preparedBlock)
consensus.switchPhase("onNewView", FBFTCommit)
} else {
consensus.ResetState()
consensus.resetState()
consensus.getLogger().Info().Msg("onNewView === announce")
}
consensus.getLogger().Info().

Loading…
Cancel
Save