Skip to content

Commit

Permalink
fix panic: sync.Map range might got nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhang2023 committed Nov 29, 2024
1 parent 129d3d0 commit bc51439
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/txpool/legacypool/legacypool.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,10 @@ func (pool *LegacyPool) loop() {
if pool.locals.contains(addr) {
return true
}
beat, _ := pool.beats.Load(addr)
beat, ok := pool.beats.Load(addr)
if !ok {
return true
}
if time.Since(beat.(time.Time)) > pool.config.Lifetime {
list := txs.Flatten()
for _, tx := range list {
Expand Down

0 comments on commit bc51439

Please sign in to comment.