Skip to content

Commit

Permalink
fix proposer payout bug with payout tx (ethereum#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvush authored and avalonche committed Mar 9, 2023
1 parent f3227d0 commit 8e3aa5e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1826,6 +1826,9 @@ func (w *worker) createProposerPayoutTx(env *environment, recipient *common.Addr
nonce := env.state.GetNonce(w.coinbase)
fee := new(big.Int).Mul(big.NewInt(21000), env.header.BaseFee)
amount := new(big.Int).Sub(profit, fee)
if amount.Sign() == -1 {
return nil, errors.New("negative amount of proposer payout")
}
gasPrice := new(big.Int).Set(env.header.BaseFee)
chainId := w.chainConfig.ChainID
log.Debug("createProposerPayoutTx", "sender", sender, "chainId", chainId.String(), "nonce", nonce, "amount", amount.String(), "gas", params.TxGas, "baseFee", env.header.BaseFee.String(), "fee", fee)
Expand Down

0 comments on commit 8e3aa5e

Please sign in to comment.