Skip to content

Commit

Permalink
wait all goroutine done to avoid prefetcher close panic
Browse files Browse the repository at this point in the history
Signed-off-by: Keefe-Liu <bianze.kernel@gmail.com>
  • Loading branch information
keefel committed Oct 28, 2021
1 parent 9348419 commit e022b2c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,15 @@ func (v *BlockValidator) ValidateState(block *types.Block, statedb *state.StateD
validateRes <- tmpFunc()
}()
}

var err error = nil
for i := 0; i < len(validateFuns); i++ {
r := <-validateRes
if r != nil {
return r
if r != nil && err == nil {
err = r
}
}
return nil
return err
}

// CalcGasLimit computes the gas limit of the next block after parent. It aims
Expand Down

0 comments on commit e022b2c

Please sign in to comment.