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

Fix division by zero #125

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading