Skip to content

Commit

Permalink
reset on commit and clone for ProposeIsValid
Browse files Browse the repository at this point in the history
  • Loading branch information
roynalnaruto committed Aug 12, 2020
1 parent 711450b commit c9c6f6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ func (p *Process) tryCommitUponSufficientPrecommits(round Round) {

// Empty message logs in preparation for the new Height.
p.ProposeLogs = map[Round]Propose{}
p.ProposeIsValid = map[Round]bool{}
p.PrevoteLogs = map[Round]map[id.Signatory]Prevote{}
p.PrecommitLogs = map[Round]map[id.Signatory]Precommit{}
p.OnceFlags = map[Round]OnceFlag{}
Expand Down
3 changes: 3 additions & 0 deletions process/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ func (state State) Clone() State {
for round, propose := range state.ProposeLogs {
cloned.ProposeLogs[round] = propose
}
for round, proposeIsValid := range state.ProposeIsValid {
cloned.ProposeIsValid[round] = proposeIsValid
}
for round, prevotes := range state.PrevoteLogs {
cloned.PrevoteLogs[round] = make(map[id.Signatory]Prevote)
for signatory, prevote := range prevotes {
Expand Down

0 comments on commit c9c6f6d

Please sign in to comment.