diff --git a/core/node/crypto/chain_txpool.go b/core/node/crypto/chain_txpool.go index ab44d08aa..903b3d448 100644 --- a/core/node/crypto/chain_txpool.go +++ b/core/node/crypto/chain_txpool.go @@ -316,9 +316,9 @@ func (pool *pendingTransactionPool) checkPendingTransactions(ctx context.Context log := dlog.FromCtx(ctx).With("chain", pool.chainID) - // grab the latest nonce, pending transactions with a nonce lower or equal are included in the chain and should + // grab the latest nonce, pending transactions with a nonce lower are included in the chain and should // have a receipt available. - nonce, err := pool.client.NonceAt(ctx, pool.wallet.Address, nil) + nonce, err := pool.client.NonceAt(ctx, pool.wallet.Address, head.Number) if err != nil { log.Warn("unable to get tx pool nonce", "err", err) return @@ -327,7 +327,7 @@ func (pool *pendingTransactionPool) checkPendingTransactions(ctx context.Context // drop transactions that have a receipt available from the pool and check others if it is time to send a // replacement transactions pool.pendingTxs.Range(func(ptxNonce uint64, ptx *txPoolPendingTransaction) bool { - ptxConfirmed := ptxNonce <= nonce + ptxConfirmed := ptxNonce < nonce if ptxConfirmed { ptx.receiptPolls++ diff --git a/core/node/crypto/chain_txpool_test.go b/core/node/crypto/chain_txpool_test.go index 77e12459e..1707dd851 100644 --- a/core/node/crypto/chain_txpool_test.go +++ b/core/node/crypto/chain_txpool_test.go @@ -9,14 +9,12 @@ import ( "time" "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/core/types" - "github.com/stretchr/testify/require" - "github.com/river-build/river/core/node/base/test" "github.com/river-build/river/core/node/crypto" "github.com/river-build/river/core/node/infra" + "github.com/stretchr/testify/require" ) func TestNewTransactionPoolWithReplaceTx(t *testing.T) {