Skip to content

Commit

Permalink
fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Aug 30, 2024
1 parent 3157730 commit df535d1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions baseapp/abci_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,15 @@ func (h *DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHan

selectedTxsSignersSeqs := make(map[string]uint64)
var (
err error
resError error
selectedTxsNums int
invalidTxs []sdk.Tx // invalid txs to be removed after the iteration
)
h.mempool.SelectBy(ctx, req.Txs, func(memTx mempool.Tx) bool {
var signerData []mempool.SignerData
signerData, err = h.signerExtAdapter.GetSigners(memTx.Tx)
signerData, err := h.signerExtAdapter.GetSigners(memTx.Tx)
if err != nil {
// propogate the error to the caller

Check failure on line 296 in baseapp/abci_utils.go

View workflow job for this annotation

GitHub Actions / Analyze

`propogate` is a misspelling of `propagate` (misspell)
resError = err
return false
}

Expand Down Expand Up @@ -325,8 +326,7 @@ func (h *DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHan
// which calls mempool.Insert, in theory everything in the pool should be
// valid. But some mempool implementations may insert invalid txs, so we
// check again.
var txBz []byte
txBz, err = h.txVerifier.PrepareProposalVerifyTx(memTx.Tx)
txBz, err := h.txVerifier.PrepareProposalVerifyTx(memTx.Tx)
if err != nil {
invalidTxs = append(invalidTxs, memTx.Tx)
} else {
Expand Down Expand Up @@ -356,8 +356,8 @@ func (h *DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHan
return true
})

if err != nil {
return nil, err
if resError != nil {
return nil, resError
}

for _, tx := range invalidTxs {
Expand Down

0 comments on commit df535d1

Please sign in to comment.