Example #1
0
const int64_t DogecoinChain::subsidy(unsigned int height, uint256 prev) const {
    if (height == 0) return 88 * COIN;
    
    int64_t s = 500000 * COIN;
    
    std::string cseed_str = prev.toString().substr(7,7);
    const char* cseed = cseed_str.c_str();
    long seed = hex2long(cseed);
    int rand = generateMTRandom(seed, 999999);
    int rand1 = 0;
    
    if(height < 100000) {
        s = (1 + rand) * COIN;
    }
    else if(height < 145000) {
        cseed_str = prev.toString().substr(7,7);
        cseed = cseed_str.c_str();
        seed = hex2long(cseed);
        rand1 = generateMTRandom(seed, 499999);
        s = (1 + rand1) * COIN;
    }
    else if(height < 600000) {
        s >>= (height / 100000);
    }