mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 19:00:46 +00:00
Merge 3b8082a10c into dddbaa4bf3
This commit is contained in:
commit
b14ed37e8c
1 changed files with 12 additions and 2 deletions
|
|
@ -538,7 +538,12 @@ func (t *SizeTracker) build(root common.Hash, blockNumber uint64, done chan buil
|
|||
|
||||
// Wait for all goroutines to complete
|
||||
if err := group.Wait(); err != nil {
|
||||
done <- buildResult{err: err}
|
||||
select {
|
||||
case done <- buildResult{err: err}:
|
||||
case <-t.abort:
|
||||
// The tracker was closed and the receiver in init has
|
||||
// already exited, the result is no longer consumed.
|
||||
}
|
||||
} else {
|
||||
stat := SizeStats{
|
||||
StateRoot: root,
|
||||
|
|
@ -554,11 +559,16 @@ func (t *SizeTracker) build(root common.Hash, blockNumber uint64, done chan buil
|
|||
ContractCodes: codes,
|
||||
ContractCodeBytes: codeBytes,
|
||||
}
|
||||
done <- buildResult{
|
||||
select {
|
||||
case done <- buildResult{
|
||||
root: root,
|
||||
blockNumber: blockNumber,
|
||||
stat: stat,
|
||||
elapsed: time.Since(start),
|
||||
}:
|
||||
case <-t.abort:
|
||||
// The tracker was closed and the receiver in init has
|
||||
// already exited, the result is no longer consumed.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue