Fix deadlock (#1401)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
This commit is contained in:
ledgerwatch 2020-12-11 12:30:44 +00:00 committed by GitHub
parent 20b3824cf6
commit 0e6d628acd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,7 +146,11 @@ func (ethash *Ethash) VerifyHeaders(chain consensus.ChainHeaderReader, headers [
defer wg.Done() defer wg.Done()
for index := range inputs { for index := range inputs {
errors[index] = ethash.verifyHeaderWorker(chain, headers, seals, index) errors[index] = ethash.verifyHeaderWorker(chain, headers, seals, index)
done <- index select {
case done <- index:
case <-abort:
return
}
} }
}() }()
} }