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() {
|
if firstgap == gtxs[0].Nonce() {
|
||||||
// We are under lock. Add the first transaction in a goroutine to avoid blocking.
|
// 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,
|
// 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?
|
// TODO: revisit if this is a problem, lock on 'from' needed?
|
||||||
|
tx := gtxs[0]
|
||||||
|
p.gapped[from] = gtxs[1:]
|
||||||
|
if len(p.gapped[from]) == 0 {
|
||||||
|
delete(p.gapped, from)
|
||||||
|
}
|
||||||
go func() {
|
go func() {
|
||||||
if err := p.add(gtxs[0]); err == nil {
|
if err := p.add(tx); err == nil {
|
||||||
// First transaction accepted, remove it from the gapped queue
|
log.Trace("Gapped blob transaction added to pool", "hash", tx.Hash(), "from", from, "nonce", tx.Nonce(), "qlen", len(p.gapped[from]))
|
||||||
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 {
|
} else {
|
||||||
log.Trace("Gapped blob transaction still not accepted", "hash", gtxs[0].Hash(), "from", from, "nonce", gtxs[0].Nonce(), "err", err)
|
log.Trace("Gapped blob transaction still not accepted", "hash", tx.Hash(), "from", from, "nonce", tx.Nonce(), "err", err)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
if len(p.gapped[from]) == 0 {
|
|
||||||
delete(p.gapped, from)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue