mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
chore: simplify removeParity
This commit is contained in:
parent
c19ff022c4
commit
da083cdf55
1 changed files with 2 additions and 10 deletions
|
|
@ -186,12 +186,6 @@ func (ptx *PooledBlobTx) RemoveParity() error {
|
|||
return errors.New("nil sidecar")
|
||||
}
|
||||
|
||||
for bit := range kzg4844.DataPerBlob {
|
||||
if !sc.Custody.IsSet(uint(bit)) {
|
||||
return errors.New("cannot remove parity for non-full payload transaction")
|
||||
}
|
||||
}
|
||||
|
||||
blobCount := len(sc.Cells) / kzg4844.CellsPerBlob
|
||||
if blobCount == 0 || len(sc.Cells)%kzg4844.CellsPerBlob != 0 {
|
||||
return errors.New("inconsistent cell count")
|
||||
|
|
@ -204,12 +198,10 @@ func (ptx *PooledBlobTx) RemoveParity() error {
|
|||
cellsWithoutParity,
|
||||
sc.Cells[offset:offset+kzg4844.DataPerBlob]...,
|
||||
)
|
||||
|
||||
for bit := 64; bit < kzg4844.CellsPerBlob; bit++ {
|
||||
sc.Custody.Clear(uint(bit))
|
||||
}
|
||||
}
|
||||
|
||||
sc.Custody = types.CustodyBitmap{}.SetData()
|
||||
|
||||
sc.Cells = cellsWithoutParity
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue