Bitcoin Forum
August 17, 2024, 11:37:54 PM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Compile issues with coin  (Read 152 times)
Enkrypto_Storm (OP)
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
October 09, 2017, 06: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?
charlie-gama
Copper Member
Jr. Member
*
Offline Offline

Activity: 133
Merit: 1

<!public>


View Profile WWW
March 01, 2018, 07: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

Support & Blockchain services
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!