mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
validate the blob tx at first to avoid unnecessary conversion
This commit is contained in:
parent
e67761ef35
commit
d05f5bc341
1 changed files with 6 additions and 4 deletions
|
|
@ -1406,12 +1406,14 @@ func (p *BlobPool) convertSidecar(txs []*types.Transaction) ([]*types.Transactio
|
||||||
}
|
}
|
||||||
var errs []error
|
var errs []error
|
||||||
for _, tx := range txs {
|
for _, tx := range txs {
|
||||||
sidecar := tx.BlobTxSidecar()
|
// Validate the transaction at first to avoid unnecessary conversion.
|
||||||
if sidecar == nil {
|
if err := p.validateTx(tx); err != nil {
|
||||||
errs = append(errs, errors.New("missing sidecar in blob transaction"))
|
errs = append(errs, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if sidecar.Version == types.BlobSidecarVersion0 {
|
|
||||||
|
sidecar := tx.BlobTxSidecar()
|
||||||
|
if tx.BlobTxSidecar().Version == types.BlobSidecarVersion0 {
|
||||||
if err := sidecar.ToV1(); err != nil {
|
if err := sidecar.ToV1(); err != nil {
|
||||||
errs = append(errs, err)
|
errs = append(errs, err)
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue