core/txpool/blobpool: move tx notification event inside add

Since we add transaction with delay, we can't have this directly in
`Add`, or we would need to set it up to handle a feed itself.
It is easier to do it directly in `add`.

The downside is that we change the granularity, creating an event for
every single blob tx.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2025-09-23 12:45:16 +02:00
parent 4e0aa78bd3
commit b60b385342
No known key found for this signature in database
GPG key ID: 0FE274EE8C95166E

View file

@ -1704,10 +1704,6 @@ func (p *BlobPool) Add(txs []*types.Transaction, sync bool) []error {
adds = append(adds, tx.WithoutBlobTxSidecar())
}
}
if len(adds) > 0 {
p.discoverFeed.Send(core.NewTxsEvent{Txs: adds})
p.insertFeed.Send(core.NewTxsEvent{Txs: adds})
}
return errs
}
@ -1908,6 +1904,8 @@ func (p *BlobPool) add(tx *types.Transaction) (err error) {
}()
}
}
p.discoverFeed.Send(core.NewTxsEvent{Txs: []*types.Transaction{tx.WithoutBlobTxSidecar()}})
p.insertFeed.Send(core.NewTxsEvent{Txs: []*types.Transaction{tx.WithoutBlobTxSidecar()}})
return nil
}