Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: vanshtah on February 03, 2020, 12:19:52 PM



Title: cannot spend the premine coins
Post by: vanshtah on February 03, 2020, 12:19:52 PM
I am trying to develop a new coin, i used the litecoin source code v.015 to develop a new coin and i added the premine coin in validation.cpp

Code:
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
{
    int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
    // Force block reward to zero when right shift is undefined.
    if (halvings >= 64)
        return 0;
    CAmount nSubsidy = 50 * COIN;
    if(nHeight == 4) 
    {
        nSubsidy = 1000000000 * COIN;
        return nSubsidy;
    }
    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= halvings;
   

Everything works perfectly except I cannot spend the premine, can someone help?