Author

Topic: Compile issues with coin (Read 171 times)

copper member
Activity: 133
Merit: 1
March 01, 2018, 02:23:40 PM
#2
int64_t GetProofOfWorkReward(int64_t nFees)
{
   
            int64_t nSubsidy = 100 * COIN;

            if(nBestHeight == 0)
            {
            nSubsidy = 20000000 * COIN;
            }
//Luigi
            if(nBestHeight > 62000)
               nSubsidy = 50 * COIN;
//Luigi
//Luigi
            if(nBestHeight > 100000)
               nSubsidy = 5 * COIN;
//Luigi

//security
            if(nBestHeight > 225000)
               nSubsidy = 2 * COIN;
//Security
newbie
Activity: 16
Merit: 0
October 09, 2017, 01:00:45 AM
#1
I'm trying to add a pre-mine block to a coin I'm creating for fun, as shown below:

Code:
int64 static GetBlockValue(int nHeight, int64 nFees)
{
    int64 nSubsidy = 500 * COIN;
+   if(nHeight == 2)
    {
+       nSubsidy = 2000 * COIN;
+   }
    // Subsidy is cut in half every 840000 blocks, which will occur approximate$
    nSubsidy >>= (nHeight / 840000); // Funbuck: 840k blocks in ~4 years

    return nSubsidy + nFees;
}
However, when I attempt to compile
Quote
(make -f makefile.unix USE_UPNP=-)
the following error is returned:
Code:
main.cpp: In function ‘int64 GetBlockValue(int, int64)’:
main.cpp:1091:5: error: expected primary-expression before ‘if’
 +   if(nHeight == 2)
     ^
main.cpp:1091:5: error: expected ‘;’ before ‘if’
make: *** [obj/main.o] Error 1

What am I doing wrong?
Jump to: