aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 2d8ac0c9bc..305d7045b9 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1176,9 +1176,14 @@ void static PruneOrphanBlocks()
int64_t GetBlockValue(int nHeight, int64_t nFees)
{
int64_t nSubsidy = 50 * COIN;
+ int halvings = nHeight / Params().SubsidyHalvingInterval();
+
+ // Force block reward to zero when right shift is undefined.
+ if (halvings >= 64)
+ return nFees;
// Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
- nSubsidy >>= (nHeight / Params().SubsidyHalvingInterval());
+ nSubsidy >>= halvings;
return nSubsidy + nFees;
}