Skip to content

Commit

Permalink
Call AddCommit when a new commit comes in during catchup
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalicevic committed Jan 11, 2025
1 parent b48a625 commit 42d65c8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions internal/consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -962,9 +962,15 @@ func (cs *State) handleMsg(mi msgInfo) {

case *CommitMessage:
cs.Logger.Info("XX received cmt message")
panic("RECEIVED COMMIT MESSAGE")
// TODO Commit has been validated Validate Basic when unmarshalling, but need to validate the the commit itself
//cs.AddCommit(aggCommit)
added, err := cs.AddCommit(msg.Commit, peerID)
if added {
cs.statsMsgQueue <- mi
}
if err != nil {
cs.Logger.Error("Failed to add commit ", "commit", msg.Commit)
}

default:
cs.Logger.Error("Unknown msg type", "type", fmt.Sprintf("%T", msg))
return
Expand Down

0 comments on commit 42d65c8

Please sign in to comment.