mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
fix calc
This commit is contained in:
parent
b9fd23ae62
commit
f20b5a4da0
1 changed files with 4 additions and 1 deletions
|
|
@ -173,10 +173,13 @@ func (r *resultStore) GetCompleted(limit int) []*fetchResult {
|
||||||
results := make([]*fetchResult, limit)
|
results := make([]*fetchResult, limit)
|
||||||
copy(results, r.items[:limit])
|
copy(results, r.items[:limit])
|
||||||
|
|
||||||
|
for _, result := range results {
|
||||||
|
r.itemsGasUsed -= result.Header.GasUsed
|
||||||
|
}
|
||||||
|
|
||||||
// Delete the results from the cache and clear the tail.
|
// Delete the results from the cache and clear the tail.
|
||||||
copy(r.items, r.items[limit:])
|
copy(r.items, r.items[limit:])
|
||||||
for i := len(r.items) - limit; i < len(r.items); i++ {
|
for i := len(r.items) - limit; i < len(r.items); i++ {
|
||||||
r.itemsGasUsed -= r.items[i].Header.GasUsed
|
|
||||||
r.items[i] = nil
|
r.items[i] = nil
|
||||||
}
|
}
|
||||||
// Advance the expected block number of the first cache entry
|
// Advance the expected block number of the first cache entry
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue