Skip to content

Commit

Permalink
fix: remove redundant parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Woosang Son committed Mar 31, 2020
1 parent 06f124b commit 7fa8319
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@ func (cs *State) enterCommit(height int64, commitRound int) {
cs.newStep()

// Maybe finalize immediately.
cs.tryFinalizeCommit(height, commitRound)
cs.tryFinalizeCommit(height)
}()

blockID, ok := cs.Votes.Precommits(commitRound).TwoThirdsMajority()
Expand Down Expand Up @@ -1331,7 +1331,7 @@ func (cs *State) enterCommit(height int64, commitRound int) {
}

// If we have the block AND +2/3 commits for it, finalize.
func (cs *State) tryFinalizeCommit(height int64, round int) {
func (cs *State) tryFinalizeCommit(height int64) {
logger := cs.Logger.With("height", height)

if cs.Height != height {
Expand All @@ -1356,11 +1356,11 @@ func (cs *State) tryFinalizeCommit(height int64, round int) {
}

// go
cs.finalizeCommit(height, round)
cs.finalizeCommit(height)
}

// Increment height and goto cstypes.RoundStepNewHeight
func (cs *State) finalizeCommit(height int64, round int) {
func (cs *State) finalizeCommit(height int64) {
if cs.Height != height || cs.Step != cstypes.RoundStepCommit {
cs.Logger.Debug(fmt.Sprintf(
"finalizeCommit(%v): Invalid args. Current step: %v/%v/%v",
Expand All @@ -1383,7 +1383,7 @@ func (cs *State) finalizeCommit(height int64, round int) {
if !block.HashesTo(blockID.Hash) {
panic(fmt.Sprintf("Cannot finalizeCommit, ProposalBlock does not hash to commit hash"))
}
if err := cs.blockExec.ValidateBlock(cs.state, round, block); err != nil {
if err := cs.blockExec.ValidateBlock(cs.state, cs.CommitRound, block); err != nil {
panic(fmt.Sprintf("+2/3 committed an invalid block: %v", err))
}

Expand Down Expand Up @@ -1638,7 +1638,7 @@ func (cs *State) addProposalBlockPart(msg *BlockPartMessage, peerID p2p.ID) (add
}
} else if cs.Step == cstypes.RoundStepCommit {
// If we're waiting on the proposal block...
cs.tryFinalizeCommit(height, cs.CommitRound)
cs.tryFinalizeCommit(height)
}
return added, nil
}
Expand Down

0 comments on commit 7fa8319

Please sign in to comment.