consensus/ubqhash: be careful with pointers and block rewards

This commit is contained in:
Luke Williams 2019-12-24 17:58:47 +01:00
parent 43f49607e0
commit 39b316e679

View file

@ -621,7 +621,7 @@ func CalcBaseBlockReward(config *params.UbqhashConfig, height *big.Int) *big.Int
for _, step := range config.MonetaryPolicy {
if height.Cmp(step.Block) > 0 {
reward = step.Reward
reward = new(big.Int).Set(step.Reward)
}
}
@ -656,7 +656,7 @@ func accumulateRewards(config *params.ChainConfig, state *state.StateDB, header
// Uncle reward step down fix. (activates along-side byzantium)
ufixReward := new(big.Int).Set(ubqhashConfig.BlockReward)
if config.IsByzantium(header.Number) {
ufixReward = reward
ufixReward = new(big.Int).Set(reward)
}
for _, uncle := range uncles {