Skip to content

Commit

Permalink
revises comments
Browse files Browse the repository at this point in the history
  • Loading branch information
staheri14 committed Aug 9, 2023
1 parent 9ee34c8 commit a818d13
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/prepare_proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ func (app *App) PrepareProposal(req abci.RequestPrepareProposal) abci.ResponsePr
)

var txs [][]byte
if app.LastBlockHeight() == 0 { // no transactions are expected when app is still at height 0 (preparing block height 1), return empty set of txs
if app.LastBlockHeight() == 0 {
// the first block is expected to be empty; hence return an empty set of txs
txs = make([][]byte, 0)
if len(req.BlockData.Txs) != 0 { // if there are non-empty txs, log it
if len(req.BlockData.Txs) != 0 {
// if the consensus layer sends non-empty set of transactions for
// block height 1, log it
app.Logger().Info(
"non-empty txs for the height 1",
"non-empty txs received from the consensus layer for block height 1",
"invalid",
len(req.BlockData.Txs),
)
Expand Down

0 comments on commit a818d13

Please sign in to comment.