Skip to content

Commit

Permalink
fix(server/v2/cometbft): fix slice appending (#21142)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Aug 1, 2024
1 parent aee9803 commit 49179eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/v2/cometbft/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,15 +315,16 @@ func (c *Consensus[T]) PrepareProposal(
}

decodedTxs := make([]T, len(req.Txs))
for _, tx := range req.Txs {
for i, tx := range req.Txs {
decTx, err := c.txCodec.Decode(tx)
if err != nil {
// TODO: vote extension meta data as a custom type to avoid possibly accepting invalid txs
// continue even if tx decoding fails
c.logger.Error("failed to decode tx", "err", err)
continue
}
decodedTxs = append(decodedTxs, decTx)

decodedTxs[i] = decTx
}

ciCtx := contextWithCometInfo(ctx, comet.Info{
Expand Down

0 comments on commit 49179eb

Please sign in to comment.