From 39b316e6793626853c08a23799b5dbbee9c6070f Mon Sep 17 00:00:00 2001 From: Luke Williams Date: Tue, 24 Dec 2019 17:58:47 +0100 Subject: [PATCH] consensus/ubqhash: be careful with pointers and block rewards --- consensus/ubqhash/consensus.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/consensus/ubqhash/consensus.go b/consensus/ubqhash/consensus.go index c890291190..66b0b0e523 100644 --- a/consensus/ubqhash/consensus.go +++ b/consensus/ubqhash/consensus.go @@ -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 {