Skip to content

Commit

Permalink
Fixes incorrect block reward calculation for Alexandria upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashy5000 committed Jul 27, 2024
1 parent 864b118 commit 053279e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion node_util/block_reward.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ func CalculateBlockReward(minerCount int64, blockHeight int) float64 {
if Env.Upgrades.Alexandria > blockHeight {
reward = math.Pow(p, float64(minerCount))
} else {
reward = math.Pow(p, float64(minerCount)) * float64(10000*(blockHeight%31536000)) // Block reward multiplies by a constant (10000) every year. This will prevent a limited supply.
years := (blockHeight - Env.Upgrades.Alexandria) / 31536000
reward = math.Pow(p, float64(minerCount)) * float64(10000*int(years)) // Block reward multiplies by a constant (10000) every year. This will prevent a limited supply.
}
return reward
}

0 comments on commit 053279e

Please sign in to comment.