Skip to content

Commit

Permalink
revert load commit step
Browse files Browse the repository at this point in the history
  • Loading branch information
czarcas7ic committed Feb 22, 2024
1 parent c534ee2 commit a4f070a
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -857,21 +857,15 @@ func testnetify(ctx *Context, home string, testnetAppCreator types.AppCreator, d
block.LastCommit.Signatures[0].Signature = vote.Signature
block.LastCommit.Signatures = []cmttypes.CommitSig{block.LastCommit.Signatures[0]}

// Create a commit signed from our validator and save it
seenCommit := cmttypes.Commit{
Height: state.LastBlockHeight,
Round: vote.Round,
BlockID: state.LastBlockID,
Signatures: []cmttypes.CommitSig{
{
BlockIDFlag: cmttypes.BlockIDFlagCommit,
Signature: vote.Signature,
ValidatorAddress: validatorAddress,
Timestamp: vote.Timestamp,
},
},
}
err = blockStore.SaveSeenCommit(state.LastBlockHeight, &seenCommit)
// Load the seenCommit of the lastBlockHeight and modify it to be signed from our validator
seenCommit := blockStore.LoadSeenCommit(state.LastBlockHeight)
seenCommit.BlockID = state.LastBlockID
seenCommit.Round = vote.Round
seenCommit.Signatures[0].Signature = vote.Signature
seenCommit.Signatures[0].ValidatorAddress = validatorAddress
seenCommit.Signatures[0].Timestamp = vote.Timestamp
seenCommit.Signatures = []cmttypes.CommitSig{seenCommit.Signatures[0]}
err = blockStore.SaveSeenCommit(state.LastBlockHeight, seenCommit)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit a4f070a

Please sign in to comment.