mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
core/txpool/blobpool: fix removal from gapped queue
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
54a69c4096
commit
6cb97cb721
1 changed files with 9 additions and 9 deletions
|
|
@ -1892,20 +1892,20 @@ func (p *BlobPool) add(tx *types.Transaction) (err error) {
|
|||
if firstgap == gtxs[0].Nonce() {
|
||||
// We are under lock. Add the first transaction in a goroutine to avoid blocking.
|
||||
// This might lead to a race beteen new calls to add and the revalidation here,
|
||||
// TODO: revisit if this is a problem, lock on gapped needed?
|
||||
go func() {
|
||||
if err := p.add(gtxs[0]); err == nil {
|
||||
// First transaction accepted, remove it from the gapped queue
|
||||
// TODO: revisit if this is a problem, lock on 'from' needed?
|
||||
tx := gtxs[0]
|
||||
p.gapped[from] = gtxs[1:]
|
||||
log.Trace("Gapped blob transaction added to pool", "hash", gtxs[0].Hash(), "from", from, "nonce", gtxs[0].Nonce(), "qlen", len(p.gapped[from]))
|
||||
} else {
|
||||
log.Trace("Gapped blob transaction still not accepted", "hash", gtxs[0].Hash(), "from", from, "nonce", gtxs[0].Nonce(), "err", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
if len(p.gapped[from]) == 0 {
|
||||
delete(p.gapped, from)
|
||||
}
|
||||
go func() {
|
||||
if err := p.add(tx); err == nil {
|
||||
log.Trace("Gapped blob transaction added to pool", "hash", tx.Hash(), "from", from, "nonce", tx.Nonce(), "qlen", len(p.gapped[from]))
|
||||
} else {
|
||||
log.Trace("Gapped blob transaction still not accepted", "hash", tx.Hash(), "from", from, "nonce", tx.Nonce(), "err", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue