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 (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"slices"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -130,10 +131,11 @@ func (q *conversionQueue) loop() {
|
||||||
if done == nil {
|
if done == nil {
|
||||||
done, interrupt = make(chan struct{}), new(atomic.Int32)
|
done, interrupt = make(chan struct{}), new(atomic.Int32)
|
||||||
|
|
||||||
tasks := cTasks
|
tasks := slices.Clone(cTasks)
|
||||||
cTasks = cTasks[:0]
|
cTasks = cTasks[:0]
|
||||||
go q.run(tasks, done, interrupt)
|
go q.run(tasks, done, interrupt)
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-done:
|
case <-done:
|
||||||
done, interrupt = nil, nil
|
done, interrupt = nil, nil
|
||||||
|
|
||||||
|
|
@ -142,7 +144,7 @@ func (q *conversionQueue) loop() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
interrupt.Store(1)
|
interrupt.Store(1)
|
||||||
log.Info("Waiting background converter to exit")
|
log.Debug("Waiting for blob proof conversion to exit")
|
||||||
<-done
|
<-done
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue