diff options
| author | Gavin Andresen <[email protected]> | 2014-04-02 21:31:17 -0400 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2014-04-02 21:31:17 -0400 |
| commit | 8556b0298d6b7101b063862fb4ab6b4a67dd2361 (patch) | |
| tree | ef7d39b0c429113b6eb18d78f2b1fa742208daad /src/main.cpp | |
| parent | Merge pull request #3931 (diff) | |
| parent | Edit subsidy_limit_test to account for BIP42 (diff) | |
| download | discoin-8556b0298d6b7101b063862fb4ab6b4a67dd2361.tar.xz discoin-8556b0298d6b7101b063862fb4ab6b4a67dd2361.zip | |
Merge pull request #3842 from ditto-b/master
Fix for GetBlockValue() after block 13,440,000
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 12f76cc9e..45f4935e4 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; } |