1 // Copyright (c) 2011 The PPCoin developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file license.txt or http://www.opensource.org/licenses/mit-license.php.
4 #include "../headers.h"
12 using namespace boost;
14 int main(int argc, char *argv[])
16 fPrintToConsole = true;
17 printf("PPCoin Begin Genesis Block\n");
20 const char* pszTimestamp = "MarketWatch 07/Nov/2011 Gold tops $1,790 to end at over six-week high";
24 txNew.vin[0].scriptSig = CScript() << 486604799 << CBigNum(4) << vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
25 txNew.vout[0].SetEmpty();
27 block.vtx.push_back(txNew);
28 block.hashPrevBlock = 0;
29 block.hashMerkleRoot = block.BuildMerkleTree();
31 block.nBits = 0x1d00ffff;
32 block.nTime = GetAdjustedTime();
36 bnTarget.SetCompact(block.nBits);
38 while (block.GetHash() > bnTarget.getuint256())
40 if ((block.nNonce >> 20) << 20 == block.nNonce)
42 if (block.vtx[0].nTime + 7200 < GetAdjustedTime() + 60)
43 block.vtx[0].nTime = GetAdjustedTime();
44 block.nTime = GetAdjustedTime();
45 printf("n=%dM hash=%s\n", block.nNonce >> 20,
46 block.GetHash().ToString().c_str());
51 printf("PPCoin Found Genesis Block:\n");
52 printf("genesis hash=%s\n", block.GetHash().ToString().c_str());
53 printf("merkle root=%s\n", block.hashMerkleRoot.ToString().c_str());
56 printf("PPCoin End Genesis Block\n");