|
|
@ -53,8 +53,6 @@ type Consensus struct { |
|
|
|
phase FBFTPhase |
|
|
|
phase FBFTPhase |
|
|
|
// current indicates what state a node is in
|
|
|
|
// current indicates what state a node is in
|
|
|
|
current State |
|
|
|
current State |
|
|
|
// isBackup declarative the node is in backup mode
|
|
|
|
|
|
|
|
isBackup bool |
|
|
|
|
|
|
|
// 2 types of timeouts: normal and viewchange
|
|
|
|
// 2 types of timeouts: normal and viewchange
|
|
|
|
consensusTimeout map[TimeoutType]*utils.Timeout |
|
|
|
consensusTimeout map[TimeoutType]*utils.Timeout |
|
|
|
// Commits collected from validators.
|
|
|
|
// Commits collected from validators.
|
|
|
@ -254,9 +252,7 @@ func (consensus *Consensus) getConsensusLeaderPrivateKey() (*bls.PrivateKeyWrapp |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (consensus *Consensus) IsBackup() bool { |
|
|
|
func (consensus *Consensus) IsBackup() bool { |
|
|
|
consensus.mutex.RLock() |
|
|
|
return consensus.registry.IsBackup() |
|
|
|
defer consensus.mutex.RUnlock() |
|
|
|
|
|
|
|
return consensus.isBackup |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (consensus *Consensus) BlockNum() uint64 { |
|
|
|
func (consensus *Consensus) BlockNum() uint64 { |
|
|
|