Guest User

Untitled

a guest
Jun 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. //if (true && genesis.GetHash() != hashGenesisBlock)
  2. if(true)
  3. {
  4. printf("Searching for genesis block...n");
  5. // This will figure out a valid hash and Nonce if you're
  6. // creating a different genesis block:
  7. uint256 hashTarget = CBigNum().SetCompact(genesis.nBits).getuint256();
  8. uint256 thash;
  9. char scratchpad[SCRYPT_SCRATCHPAD_SIZE];
  10.  
  11. while(true)
  12. {
  13. scrypt_1024_1_1_256_sp_generic(BEGIN(genesis.nVersion), BEGIN(thash), scratchpad);
  14. if (thash <= hashTarget)
  15. break;
  16. if ((genesis.nNonce & 0xFFF) == 0)
  17. {
  18. printf("nonce %08X: hash = %s (target = %s)n", genesis.nNonce, thash.ToString().c_str(), hashTarget.ToString().c_str());
  19. }
  20. ++genesis.nNonce;
  21. if (genesis.nNonce == 0)
  22. {
  23. printf("NONCE WRAPPED, incrementing timen");
  24. ++genesis.nTime;
  25. }
  26. }
  27. printf("block.nTime = %u n", genesis.nTime);
  28. printf("block.nNonce = %u n", genesis.nNonce);
  29. printf("block.GetHash = %sn", genesis.GetHash().ToString().c_str());
  30.  
  31. }
Add Comment
Please, Sign In to add comment