diff --git a/common/leak/ignore_list.go b/common/leak/ignore_list.go index 56134dcabc..530faf3acc 100644 --- a/common/leak/ignore_list.go +++ b/common/leak/ignore_list.go @@ -13,11 +13,15 @@ func IgnoreList() []goleak.Option { goleak.IgnoreTopFunction("github.com/rjeczalik/notify._Cfunc_CFRunLoopRun"), // todo: this leaks should be fixed - goleak.IgnoreTopFunction("github.com/ethereum/go-ethereum/metrics.(*meterArbiter).tick"), + goleak.IgnoreTopFunction("github.com/ethereum/go-ethereum/accounts/abi/bind/backends.nullSubscription.func1"), + goleak.IgnoreTopFunction("github.com/ethereum/go-ethereum/accounts/abi/bind/backends.(*filterBackend).SubscribeNewTxsEvent.func1"), + goleak.IgnoreTopFunction("github.com/ethereum/go-ethereum/accounts/abi/bind/backends.(*filterBackend).SubscribePendingLogsEvent.func1"), goleak.IgnoreTopFunction("github.com/ethereum/go-ethereum/consensus/ethash.(*remoteSealer).loop"), goleak.IgnoreTopFunction("github.com/ethereum/go-ethereum/core.(*BlockChain).updateFutureBlocks"), goleak.IgnoreTopFunction("github.com/ethereum/go-ethereum/core/state/snapshot.(*diskLayer).generate"), - goleak.IgnoreTopFunction("github.com/ethereum/go-ethereum/accounts/abi/bind/backends.nullSubscription.func1"), goleak.IgnoreTopFunction("github.com/ethereum/go-ethereum/eth/filters.(*EventSystem).eventLoop"), + goleak.IgnoreTopFunction("github.com/ethereum/go-ethereum/event.NewSubscription.func1"), + goleak.IgnoreTopFunction("github.com/ethereum/go-ethereum/event.NewSubscription"), + goleak.IgnoreTopFunction("github.com/ethereum/go-ethereum/metrics.(*meterArbiter).tick"), } } diff --git a/core/txpool/txpool.go b/core/txpool/txpool.go index 70d1761f96..4efde1ec9e 100644 --- a/core/txpool/txpool.go +++ b/core/txpool/txpool.go @@ -614,8 +614,6 @@ func (pool *TxPool) Content() (map[common.Address]types.Transactions, map[common queued[addr] = list.Flatten() } - pool.mu.RUnlock() - return pending, queued } diff --git a/miner/worker_test.go b/miner/worker_test.go index 91cf052e25..bf08e2c0e3 100644 --- a/miner/worker_test.go +++ b/miner/worker_test.go @@ -44,6 +44,40 @@ import ( "github.com/ethereum/go-ethereum/tests/bor/mocks" ) +// TODO(raneet10): Duplicate initialization from miner/test_backend.go . Recheck whether we need both +// func init() { +// testTxPoolConfig = txpool.DefaultConfig +// testTxPoolConfig.Journal = "" +// ethashChainConfig = new(params.ChainConfig) +// *ethashChainConfig = *params.TestChainConfig +// cliqueChainConfig = new(params.ChainConfig) +// *cliqueChainConfig = *params.TestChainConfig +// cliqueChainConfig.Clique = ¶ms.CliqueConfig{ +// Period: 10, +// Epoch: 30000, +// } + +// signer := types.LatestSigner(params.TestChainConfig) +// tx1 := types.MustSignNewTx(testBankKey, signer, &types.AccessListTx{ +// ChainID: params.TestChainConfig.ChainID, +// Nonce: 0, +// To: &testUserAddress, +// Value: big.NewInt(1000), +// Gas: params.TxGas, +// GasPrice: big.NewInt(params.InitialBaseFee), +// }) +// pendingTxs = append(pendingTxs, tx1) + +// tx2 := types.MustSignNewTx(testBankKey, signer, &types.LegacyTx{ +// Nonce: 1, +// To: &testUserAddress, +// Value: big.NewInt(1000), +// Gas: params.TxGas, +// GasPrice: big.NewInt(params.InitialBaseFee), +// }) +// newTxs = append(newTxs, tx2) +// } + // newTestWorker creates a new test worker with the given parameters. // nolint:unparam func newTestWorker(t TensingObject, chainConfig *params.ChainConfig, engine consensus.Engine, db ethdb.Database, blocks int, noempty bool, delay uint, opcodeDelay uint) (*worker, *testWorkerBackend, func()) {