mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 03:10:48 +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
|
// Wait for all goroutines to complete
|
||||||
if err := group.Wait(); err != nil {
|
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 {
|
} else {
|
||||||
stat := SizeStats{
|
stat := SizeStats{
|
||||||
StateRoot: root,
|
StateRoot: root,
|
||||||
|
|
@ -554,11 +559,16 @@ func (t *SizeTracker) build(root common.Hash, blockNumber uint64, done chan buil
|
||||||
ContractCodes: codes,
|
ContractCodes: codes,
|
||||||
ContractCodeBytes: codeBytes,
|
ContractCodeBytes: codeBytes,
|
||||||
}
|
}
|
||||||
done <- buildResult{
|
select {
|
||||||
|
case done <- buildResult{
|
||||||
root: root,
|
root: root,
|
||||||
blockNumber: blockNumber,
|
blockNumber: blockNumber,
|
||||||
stat: stat,
|
stat: stat,
|
||||||
elapsed: time.Since(start),
|
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