Skip to content

Commit

Permalink
mempool: minor cleanup after backport from v0.35 (#8971)
Browse files Browse the repository at this point in the history
- Remove warning log for issue #8775.
- Fix call to FlushAsync (no error is reported).
- Don't log on rechecks, it's the default (manual backport of #8969).

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
  • Loading branch information
tnasu and M. J. Fromberger committed Jul 13, 2023
1 parent 7c66db2 commit 8effabb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 7 additions & 7 deletions mempool/v1/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,10 @@ func (txmp *TxMempool) Update(
func (txmp *TxMempool) initialTxCallback(wtx *WrappedTx, res *abci.Response) {
checkTxRes, ok := res.Value.(*abci.Response_CheckTx)
if !ok {
txmp.logger.Error("mempool: received incorrect result type in CheckTx callback",
"expected", reflect.TypeOf(&abci.Response_CheckTx{}).Name(),
"got", reflect.TypeOf(res.Value).Name(),
)
return
}

Expand Down Expand Up @@ -620,10 +624,8 @@ func (txmp *TxMempool) insertTx(wtx *WrappedTx) {
func (txmp *TxMempool) recheckTxCallback(req *abci.Request, res *abci.Response) {
checkTxRes, ok := res.Value.(*abci.Response_CheckTx)
if !ok {
txmp.logger.Error("mempool: received incorrect result type in CheckTx callback",
"expected", reflect.TypeOf(&abci.Response_CheckTx{}).Name(),
"got", reflect.TypeOf(res.Value).Name(),
)
// Don't log this; this is the default callback and other response types
// can safely be ignored.
return
}

Expand Down Expand Up @@ -711,9 +713,7 @@ func (txmp *TxMempool) recheckTransactions() {
})
}

if err := txmp.proxyAppConn.FlushAsync(); err != nil {
txmp.logger.Error("failed to flush transactions during recheck", "err", err)
}
txmp.proxyAppConn.FlushAsync()
}

// canAddTx returns an error if we cannot insert the provided *WrappedTx into
Expand Down
1 change: 0 additions & 1 deletion node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ func createMempoolAndMempoolReactor(
mempoolv0.WithPostCheck(sm.TxPostCheck(state)),
)

mp.SetLogger(logger)
mp.SetLogger(logger)

reactor := mempoolv0.NewReactor(
Expand Down

0 comments on commit 8effabb

Please sign in to comment.