@@ -2,14 +2,11 @@ package v1
2
2
3
3
import (
4
4
"fmt"
5
- "runtime"
6
5
"sort"
7
6
"sync"
8
7
"sync/atomic"
9
8
"time"
10
9
11
- "github.com/creachadair/taskgroup"
12
-
13
10
abci "github.com/tendermint/tendermint/abci/types"
14
11
"github.com/tendermint/tendermint/config"
15
12
"github.com/tendermint/tendermint/libs/clist"
@@ -650,8 +647,6 @@ func (txmp *TxMempool) insertTx(wtx *WrappedTx) {
650
647
// that case is handled by addNewTransaction instead.
651
648
func (txmp * TxMempool ) handleRecheckResult (tx types.Tx , checkTxRes * abci.ResponseCheckTx ) {
652
649
txmp .metrics .RecheckTimes .Add (1 )
653
- txmp .mtx .Lock ()
654
- defer txmp .mtx .Unlock ()
655
650
656
651
// Find the transaction reported by the ABCI callback. It is possible the
657
652
// transaction was evicted during the recheck, in which case the transaction
@@ -713,34 +708,23 @@ func (txmp *TxMempool) recheckTransactions() {
713
708
714
709
// Issue CheckTx calls for each remaining transaction, and when all the
715
710
// rechecks are complete signal watchers that transactions may be available.
716
- go func () {
717
- g , start := taskgroup .New (nil ).Limit (2 * runtime .NumCPU ())
718
-
719
- for _ , wtx := range wtxs {
720
- wtx := wtx
721
- start (func () error {
722
- // The response for this CheckTx is handled by the default recheckTxCallback.
723
- rsp , err := txmp .proxyAppConn .CheckTxSync (abci.RequestCheckTx {
724
- Tx : wtx .tx ,
725
- Type : abci .CheckTxType_Recheck ,
726
- })
727
- if err != nil {
728
- txmp .logger .Error ("failed to execute CheckTx during recheck" ,
729
- "err" , err , "hash" , fmt .Sprintf ("%x" , wtx .tx .Hash ()))
730
- } else {
731
- txmp .handleRecheckResult (wtx .tx , rsp )
732
- }
733
- return nil
734
- })
711
+ for _ , wtx := range wtxs {
712
+ wtx := wtx
713
+ // The response for this CheckTx is handled by the default recheckTxCallback.
714
+ rsp , err := txmp .proxyAppConn .CheckTxSync (abci.RequestCheckTx {
715
+ Tx : wtx .tx ,
716
+ Type : abci .CheckTxType_Recheck ,
717
+ })
718
+ if err != nil {
719
+ txmp .logger .Error ("failed to execute CheckTx during recheck" ,
720
+ "err" , err , "hash" , fmt .Sprintf ("%x" , wtx .tx .Hash ()))
721
+ } else {
722
+ txmp .handleRecheckResult (wtx .tx , rsp )
735
723
}
736
- _ = txmp .proxyAppConn .FlushAsync ()
724
+ }
725
+ _ = txmp .proxyAppConn .FlushAsync ()
737
726
738
- // When recheck is complete, trigger a notification for more transactions.
739
- _ = g .Wait ()
740
- txmp .mtx .Lock ()
741
- defer txmp .mtx .Unlock ()
742
- txmp .notifyTxsAvailable ()
743
- }()
727
+ txmp .notifyTxsAvailable ()
744
728
}
745
729
746
730
// canAddTx returns an error if we cannot insert the provided *WrappedTx into
0 commit comments