PPCoin: Official genesis blocks
[novacoin.git] / src / ppcoin / genesis.cpp
index 9609161..36b0e4d 100644 (file)
@@ -1,7 +1,6 @@
 // Copyright (c) 2011 The PPCoin developers
 // Distributed under the MIT/X11 software license, see the accompanying
 // file license.txt or http://www.opensource.org/licenses/mit-license.php.
-#include "../headers.h"
 #include "../db.h"
 #include "../net.h"
 #include "../init.h"
@@ -17,19 +16,20 @@ int main(int argc, char *argv[])
     printf("PPCoin Begin Genesis Block\n");
 
     // Genesis block
-    const char* pszTimestamp = "MarketWatch 07/Nov/2011 Gold tops $1,790 to end at over six-week high";
+    const char* pszTimestamp = "Matonis 07-AUG-2012 Parallel Currencies And The Roadmap To Monetary Freedom";
     CTransaction txNew;
     txNew.vin.resize(1);
     txNew.vout.resize(1);
-    txNew.vin[0].scriptSig = CScript() << 486604799 << CBigNum(4) << vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
+    txNew.vin[0].scriptSig = CScript() << 486604799 << CBigNum(9999) << vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
     txNew.vout[0].SetEmpty();
+    txNew.nTime = 1345083810; // only for testnet
     CBlock block;
     block.vtx.push_back(txNew);
     block.hashPrevBlock = 0;
     block.hashMerkleRoot = block.BuildMerkleTree();
     block.nVersion = 1;
-    block.nBits    = 0x1d00ffff;
-    block.nTime    = GetAdjustedTime();
+    block.nBits    = CBigNum(~uint256(0) >> 28).GetCompact(); //0x1d00ffff;
+    block.nTime    = 1345090000; //GetAdjustedTime();
     block.nNonce   = 0;
 
     CBigNum bnTarget;
@@ -39,9 +39,16 @@ int main(int argc, char *argv[])
     {
         if ((block.nNonce >> 20) << 20 == block.nNonce)
         {
-            if (block.vtx[0].nTime + 7200 < GetAdjustedTime() + 60)
-                block.vtx[0].nTime = GetAdjustedTime();
-            block.nTime = GetAdjustedTime();
+            //if (block.vtx[0].nTime + 7200 < GetAdjustedTime() + 60)
+            //{
+            //    block.vtx[0].nTime = GetAdjustedTime();
+            //    block.hashMerkleRoot = block.BuildMerkleTree();
+            //}
+            if (block.nNonce > 4000000000)
+            {
+                block.nTime++; // = GetAdjustedTime();
+                block.nNonce = 0;
+            }
             printf("n=%dM hash=%s\n", block.nNonce >> 20,
                    block.GetHash().ToString().c_str());
         }