Skip to content

Commit 8e3aa5e

Browse files
dvushavalonche
authored andcommitted
fix proposer payout bug with payout tx (ethereum#27)
1 parent f3227d0 commit 8e3aa5e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

miner/worker.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,6 +1826,9 @@ func (w *worker) createProposerPayoutTx(env *environment, recipient *common.Addr
18261826
nonce := env.state.GetNonce(w.coinbase)
18271827
fee := new(big.Int).Mul(big.NewInt(21000), env.header.BaseFee)
18281828
amount := new(big.Int).Sub(profit, fee)
1829+
if amount.Sign() == -1 {
1830+
return nil, errors.New("negative amount of proposer payout")
1831+
}
18291832
gasPrice := new(big.Int).Set(env.header.BaseFee)
18301833
chainId := w.chainConfig.ChainID
18311834
log.Debug("createProposerPayoutTx", "sender", sender, "chainId", chainId.String(), "nonce", nonce, "amount", amount.String(), "gas", params.TxGas, "baseFee", env.header.BaseFee.String(), "fee", fee)

0 commit comments

Comments
 (0)