Created
November 21, 2017 01:05
-
-
Save blockchain-ai/89de00431cf2cfbca058f137f4c5653f to your computer and use it in GitHub Desktop.
tarocoin_add_code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(true && block.GetHash() != hashGenesisBlock) | |
{ | |
printf("Searching for genesis block...\n"); | |
//this will figure out a vlid hash and nonce if you're | |
//createing a different genesis block. | |
uint256 hashTarget = CBigNum().SetCompact(block.nBits).getuint256(); | |
uint256 thash; | |
char scratchpad[SCRYPT_SCRATCHPAD_SIZE]; | |
loop | |
{ | |
scrypt_1024_1_1_256_sp(BEGIN(block.nVersion), BEGIN(thash), scratchpad); | |
if (thash <= hashTarget) | |
break; | |
if ((block.nNonce & 0xFF) == 0) | |
{ | |
printf("nonce %08X: hash = %s (target = %s)\n", block.nNonce, thash.ToString().c_str(), hashTarget.ToString().c_str()); | |
} | |
++block.nNonce; | |
if (block.nNonce == 0) | |
{ | |
printf("NONCE WRAPPED, inccrementing time\n"); | |
++block.nTime; | |
} | |
} | |
printf("block.nTime = %u \n",block.nTime); | |
printf("block.nNonce = %u \n",block.nNonce); | |
printf("block.GetHash = %s \n",block.GetHash().ToString().c_str()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment