Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Fix division by zero (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wazzymandias authored Oct 10, 2023
1 parent 45e865e commit be459ef
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion miner/environment_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,13 @@ func (envDiff *environmentDiff) commitSBundle(b *types.SimSBundle, chData chainD
return errors.New("coinbase balance decreased")
}

gotEGP := new(big.Int).Div(coinbaseDelta, gasDelta)
var gotEGP *big.Int
if gasDelta.Cmp(common.Big0) == 0 {
gotEGP = new(big.Int).SetUint64(0)
} else {
gotEGP = new(big.Int).Div(coinbaseDelta, gasDelta)
}

simEGP := new(big.Int).Set(b.MevGasPrice)

// allow > 1% difference
Expand Down

0 comments on commit be459ef

Please sign in to comment.