eth/downloader: fix racy test

This commit is contained in:
Marius van der Wijden 2025-01-30 11:03:26 +01:00
parent 52766bedb9
commit 85abb73a7e

View file

@ -210,7 +210,7 @@ func newTestBlockchain(blocks []*types.Block) *core.BlockChain {
testBlockchains[head] = new(testBlockchain) testBlockchains[head] = new(testBlockchain)
} }
tbc := testBlockchains[head] tbc := testBlockchains[head]
testBlockchainsLock.Unlock() defer testBlockchainsLock.Unlock()
// Ensure that the database is generated // Ensure that the database is generated
tbc.gen.Do(func() { tbc.gen.Do(func() {