mempool: don't log message type mismatch in the default callback (#8969)

This commit is contained in:
M. J. Fromberger
2022-07-11 18:06:49 -07:00
committed by GitHub
parent f98de20f7e
commit cb93d3b587

View File

@@ -462,6 +462,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
}
@@ -630,10 +634,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
}