core/txpool/blobpool: return error on underpriced

This also solves a forwarding issue, where underpriced transactions
were announced.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2026-01-12 15:50:56 +01:00
parent 0d13437991
commit e9d185f15b
No known key found for this signature in database
GPG key ID: 0FE274EE8C95166E

View file

@ -1676,6 +1676,14 @@ func (p *BlobPool) addLocked(tx *types.Transaction, checkGapped bool) (err error
}
p.updateStorageMetrics()
// If we've just dropped the added transaction, it was clearly underpriced.
// We could also try to check for this earlier, but it is compex because
// of the rolling fee caculations.
if !p.lookup.exists(tx.Hash()) {
addUnderpricedMeter.Mark(1)
return txpool.ErrUnderpriced
}
addValidMeter.Mark(1)
// Notify all listeners of the new arrival