mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-04-12 12:48:33 +00:00
core: fix deadlock in parallel state processor
This commit is contained in:
parent
ff772bfa08
commit
077a58a49c
1 changed files with 3 additions and 1 deletions
|
|
@ -200,6 +200,7 @@ func (p *ParallelStateProcessor) resultHandler(block *types.Block, preTxStateRea
|
|||
for {
|
||||
select {
|
||||
case res := <-txResCh:
|
||||
numTxComplete++
|
||||
if execErr == nil {
|
||||
if res.err != nil {
|
||||
execErr = res.err
|
||||
|
|
@ -212,7 +213,6 @@ func (p *ParallelStateProcessor) resultHandler(block *types.Block, preTxStateRea
|
|||
}
|
||||
}
|
||||
}
|
||||
numTxComplete++
|
||||
if numTxComplete == len(block.Transactions()) {
|
||||
break loop
|
||||
}
|
||||
|
|
@ -220,6 +220,8 @@ func (p *ParallelStateProcessor) resultHandler(block *types.Block, preTxStateRea
|
|||
}
|
||||
|
||||
if execErr != nil {
|
||||
// Drain stateRootCalcResCh so calcAndVerifyRoot goroutine can exit.
|
||||
<-stateRootCalcResCh
|
||||
resCh <- &ProcessResultWithMetrics{ProcessResult: &ProcessResult{Error: execErr}}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue