mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
Fix for negative values
This commit is contained in:
parent
4c63a880c5
commit
abcc52f688
1 changed files with 3 additions and 0 deletions
|
|
@ -161,6 +161,9 @@ func AccumulateRewards(statedb *state.StateDB, header *types.Header, uncles []*t
|
||||||
statedb.AddBalance(uncle.Coinbase, r)
|
statedb.AddBalance(uncle.Coinbase, r)
|
||||||
|
|
||||||
r.Div(BlockReward, big32)
|
r.Div(BlockReward, big32)
|
||||||
|
if r.Cmp(big.NewInt(0)) < 0 {
|
||||||
|
r = big.NewInt(0)
|
||||||
|
}
|
||||||
reward.Add(reward, r)
|
reward.Add(reward, r)
|
||||||
}
|
}
|
||||||
statedb.AddBalance(header.Coinbase, reward)
|
statedb.AddBalance(header.Coinbase, reward)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue