mempool: remove panic when recheck-tx was not sent to ABCI application

This commit is contained in:
William Banfield
2021-10-15 11:44:08 -04:00
parent b95c261981
commit 3b197a79c2
2 changed files with 12 additions and 6 deletions
+6 -5
View File
@@ -4,7 +4,6 @@ import (
"bytes"
"context"
"errors"
"fmt"
"sync"
"sync/atomic"
@@ -451,10 +450,12 @@ func (mem *CListMempool) resCbRecheck(req *abci.Request, res *abci.Response) {
tx := req.GetCheckTx().Tx
memTx := mem.recheckCursor.Value.(*mempoolTx)
if !bytes.Equal(tx, memTx.tx) {
panic(fmt.Sprintf(
"Unexpected tx response from proxy during recheck\nExpected %X, got %X",
memTx.tx,
tx))
mem.logger.Error(
"re-CheckTx transaction mismatch",
"got", tx,
"expected", memTx.tx,
)
return
}
var postCheckErr error
if mem.postCheck != nil {
+6 -1
View File
@@ -643,7 +643,12 @@ func (txmp *TxMempool) defaultTxCallback(req *abci.Request, res *abci.Response)
tx := req.GetCheckTx().Tx
wtx := txmp.recheckCursor.Value.(*WrappedTx)
if !bytes.Equal(tx, wtx.tx) {
panic(fmt.Sprintf("re-CheckTx transaction mismatch; got: %X, expected: %X", wtx.tx.Hash(), types.Tx(tx).Key()))
txmp.logger.Error(
"re-CheckTx transaction mismatch",
"got", wtx.tx.Hash(),
"expected", types.Tx(tx).Key(),
)
return
}
// Only evaluate transactions that have not been removed. This can happen