mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
cleanup
This commit is contained in:
parent
aa65601146
commit
3657810695
1 changed files with 5 additions and 7 deletions
|
|
@ -42,9 +42,11 @@ type resultStore struct {
|
||||||
// this index.
|
// this index.
|
||||||
throttleThreshold uint64
|
throttleThreshold uint64
|
||||||
|
|
||||||
lock sync.RWMutex
|
// pendingCount is the current number of in-flight block body retrievals
|
||||||
|
// contained in items.
|
||||||
pendingCount int
|
pendingCount int
|
||||||
|
|
||||||
|
lock sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
func newResultStore(size int) *resultStore {
|
func newResultStore(size int) *resultStore {
|
||||||
|
|
@ -177,11 +179,7 @@ func (r *resultStore) GetCompleted(limit int) []*fetchResult {
|
||||||
for i := 0; i < limit; i++ {
|
for i := 0; i < limit; i++ {
|
||||||
totalSize += r.items[i].Size()
|
totalSize += r.items[i].Size()
|
||||||
}
|
}
|
||||||
if limit > 0 {
|
|
||||||
blockSizeGauge.Update(int64(totalSize / limit))
|
|
||||||
r.pendingCount -= limit
|
r.pendingCount -= limit
|
||||||
}
|
|
||||||
|
|
||||||
pendingBodyGauge.Update(int64(r.pendingCount))
|
pendingBodyGauge.Update(int64(r.pendingCount))
|
||||||
|
|
||||||
results := make([]*fetchResult, limit)
|
results := make([]*fetchResult, limit)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue