Skip to content

Commit

Permalink
fix: lock when clear bundleMetrics
Browse files Browse the repository at this point in the history
  • Loading branch information
irrun committed Dec 18, 2024
1 parent e270ddb commit 4b0fd83
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/txpool/bundlepool/bundlepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ func (p *BundlePool) clearLoop() {

for number := range p.bundleMetrics {
if number <= currentNumber-types.MaxBundleAliveBlock {
p.bundleMetricsMu.Lock()
delete(p.bundleMetrics, number)
p.bundleMetricsMu.Unlock()
}
}
}
Expand Down

0 comments on commit 4b0fd83

Please sign in to comment.