eth/fetcher: plug goroutine-leak in test

This commit is contained in:
Martin Holst Swende 2023-10-16 09:54:41 +02:00 committed by Marius van der Wijden
parent 5e52d8dc8b
commit b186dedd8d

View file

@ -2007,8 +2007,10 @@ func TestTransactionForgotten(t *testing.T) {
}, },
func(string, []common.Hash) error { return nil }, func(string, []common.Hash) error { return nil },
) )
go fetcher.loop() fetcher.Start()
// Create a TX which is 5 minutes old, and one which is recent defer fetcher.Stop()
// Create a TXuno
//which is 5 minutes old, and one which is recent
tx1 := types.NewTx(&types.LegacyTx{Nonce: 0}) tx1 := types.NewTx(&types.LegacyTx{Nonce: 0})
tx1.SetTime(time.Now().Add(-maxTxUnderpricedTimeout - 1*time.Second)) tx1.SetTime(time.Now().Add(-maxTxUnderpricedTimeout - 1*time.Second))
tx2 := types.NewTx(&types.LegacyTx{Nonce: 1}) tx2 := types.NewTx(&types.LegacyTx{Nonce: 1})