Skip to content

Commit

Permalink
revert: it's correct to create the Proposal Block iff privValidator i…
Browse files Browse the repository at this point in the history
…s Proposer
  • Loading branch information
torao committed Feb 24, 2021
1 parent a32322e commit d9d01ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -1096,14 +1096,14 @@ func (cs *State) createProposalBlock(round int) (block *types.Block, blockParts
if cs.privValidator == nil {
panic("entered createProposalBlock with privValidator being nil")
}
_, err := cs.privValidator.GetPubKey()
pubKey, err := cs.privValidator.GetPubKey()
if err != nil {
// If this node is a validator & proposer in the current round, it will
// miss the opportunity to create a block.
cs.Logger.Error("Error on retrival of pubkey", "err", err)
return
}
proposerAddr := cs.Validators.SelectProposer(cs.state.LastProofHash, cs.Height, round).Address
proposerAddr := pubKey.Address()
message := cs.state.MakeHashMessage(round)

proof, err := cs.privValidator.GenerateVRFProof(message)
Expand Down

0 comments on commit d9d01ed

Please sign in to comment.