Skip to content

Commit

Permalink
consensus/misc: tiny optimizations
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Holst Swende <martin@swende.se>
  • Loading branch information
karalabe and holiman committed May 25, 2023
1 parent 66c86af commit fc032c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions consensus/misc/eip4844.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ func CalcExcessDataGas(parentExcessDataGas *big.Int, blobs int) *big.Int {

targetGas := big.NewInt(params.BlobTxTargetDataGasPerBlock)
if excessDataGas.Cmp(targetGas) < 0 {
return new(big.Int)
return excessDataGas.SetUint64(0)
}
return new(big.Int).Sub(excessDataGas, targetGas)
return excessDataGas.Sub(excessDataGas, targetGas)
}

// CalcBlobFee calculates the blobfee from the header's excess data gas field.
Expand Down

0 comments on commit fc032c3

Please sign in to comment.