MaxGuevara/quark — pull request #10 by huanzhang12 (2014-06-30 02:56:58+00:00)
Title: GetBlockValue() returns wrong values when nHeight >= 3870720

The C++ right shift operation is undefined when the right operand is greater than or equal to the length in bits of the promoted left operand. On Intel x86 architecture, a right shift is translated into a "sar" or "shrd" instruction. When (nHeight / 60480) is greater than or equal to 64, it is observed that these right shift instructions will shift nSubsidy by ((nHeight / 60480) mod 64). For example, at block 3870720 (=60480*64), the original GetBlockValue() returns 2048*COINS instead of 1*COINS. This patch fixed this issue and GetBlockValue() will return 1*COINS for any block height greater than 665279.