mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
core/txpool/blobpool: fix data race in conversionQueue
This commit is contained in:
parent
d54a983742
commit
fdc32a53ad
1 changed files with 4 additions and 2 deletions
|
|
@ -18,6 +18,7 @@ package blobpool
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"slices"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
|
|
@ -130,10 +131,11 @@ func (q *conversionQueue) loop() {
|
|||
if done == nil {
|
||||
done, interrupt = make(chan struct{}), new(atomic.Int32)
|
||||
|
||||
tasks := cTasks
|
||||
tasks := slices.Clone(cTasks)
|
||||
cTasks = cTasks[:0]
|
||||
go q.run(tasks, done, interrupt)
|
||||
}
|
||||
|
||||
case <-done:
|
||||
done, interrupt = nil, nil
|
||||
|
||||
|
|
@ -142,7 +144,7 @@ func (q *conversionQueue) loop() {
|
|||
return
|
||||
}
|
||||
interrupt.Store(1)
|
||||
log.Info("Waiting background converter to exit")
|
||||
log.Debug("Waiting for blob proof conversion to exit")
|
||||
<-done
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue