mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-13 21:31:23 +00:00
consensus: isProposer func
This commit is contained in:
@ -804,7 +804,7 @@ func (cs *ConsensusState) enterPropose(height int, round int) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !bytes.Equal(cs.Validators.GetProposer().Address, cs.privValidator.GetAddress()) {
|
if !cs.isProposer() {
|
||||||
cs.Logger.Info("enterPropose: Not our turn to propose", "proposer", cs.Validators.GetProposer().Address, "privValidator", cs.privValidator)
|
cs.Logger.Info("enterPropose: Not our turn to propose", "proposer", cs.Validators.GetProposer().Address, "privValidator", cs.privValidator)
|
||||||
if cs.Validators.HasAddress(cs.privValidator.GetAddress()) {
|
if cs.Validators.HasAddress(cs.privValidator.GetAddress()) {
|
||||||
cs.Logger.Debug("This node is a validator")
|
cs.Logger.Debug("This node is a validator")
|
||||||
@ -818,6 +818,10 @@ func (cs *ConsensusState) enterPropose(height int, round int) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (cs *ConsensusState) isProposer() bool {
|
||||||
|
return bytes.Equal(cs.Validators.GetProposer().Address, cs.privValidator.GetAddress())
|
||||||
|
}
|
||||||
|
|
||||||
func (cs *ConsensusState) defaultDecideProposal(height, round int) {
|
func (cs *ConsensusState) defaultDecideProposal(height, round int) {
|
||||||
var block *types.Block
|
var block *types.Block
|
||||||
var blockParts *types.PartSet
|
var blockParts *types.PartSet
|
||||||
|
Reference in New Issue
Block a user