mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 21:26:42 +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
|
||||
for _, tx := range txs {
|
||||
sidecar := tx.BlobTxSidecar()
|
||||
if sidecar == nil {
|
||||
errs = append(errs, errors.New("missing sidecar in blob transaction"))
|
||||
// Validate the transaction at first to avoid unnecessary conversion.
|
||||
if err := p.validateTx(tx); err != nil {
|
||||
errs = append(errs, err)
|
||||
continue
|
||||
}
|
||||
if sidecar.Version == types.BlobSidecarVersion0 {
|
||||
|
||||
sidecar := tx.BlobTxSidecar()
|
||||
if tx.BlobTxSidecar().Version == types.BlobSidecarVersion0 {
|
||||
if err := sidecar.ToV1(); err != nil {
|
||||
errs = append(errs, err)
|
||||
continue
|
||||
|
|
|
|||
Loading…
Reference in a new issue