Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //if (true && genesis.GetHash() != hashGenesisBlock)
- if(true)
- {
- printf("Searching for genesis block...n");
- // This will figure out a valid hash and Nonce if you're
- // creating a different genesis block:
- uint256 hashTarget = CBigNum().SetCompact(genesis.nBits).getuint256();
- uint256 thash;
- char scratchpad[SCRYPT_SCRATCHPAD_SIZE];
- while(true)
- {
- scrypt_1024_1_1_256_sp_generic(BEGIN(genesis.nVersion), BEGIN(thash), scratchpad);
- if (thash <= hashTarget)
- break;
- if ((genesis.nNonce & 0xFFF) == 0)
- {
- printf("nonce %08X: hash = %s (target = %s)n", genesis.nNonce, thash.ToString().c_str(), hashTarget.ToString().c_str());
- }
- ++genesis.nNonce;
- if (genesis.nNonce == 0)
- {
- printf("NONCE WRAPPED, incrementing timen");
- ++genesis.nTime;
- }
- }
- printf("block.nTime = %u n", genesis.nTime);
- printf("block.nNonce = %u n", genesis.nNonce);
- printf("block.GetHash = %sn", genesis.GetHash().ToString().c_str());
- }
Add Comment
Please, Sign In to add comment