Advertisement
Guest User

Untitled

a guest
Dec 6th, 2015
9,872
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1.  
  2. if (true && block.GetHash() != hashGenesisBlock)
  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(block.nBits).getuint256();
  8. uint256 thash;
  9. char scratchpad[SCRYPT_SCRATCHPAD_SIZE];
  10.  
  11. loop
  12. {
  13. scrypt_1024_1_1_256_sp(BEGIN(block.nVersion), BEGIN(thash), scratchpad);
  14. if (thash <= hashTarget)
  15. break;
  16. if ((block.nNonce & 0xFFF) == 0)
  17. {
  18. printf("nonce %08X: hash = %s (target = %s)\n", block.nNonce, thash.ToString().c_str(), hashTarget.ToString().c_str());
  19. }
  20. ++block.nNonce;
  21. if (block.nNonce == 0)
  22. {
  23. printf("NONCE WRAPPED, incrementing time\n");
  24. ++block.nTime;
  25. }
  26. }
  27. printf("block.nTime = %u \n", block.nTime);
  28. printf("block.nNonce = %u \n", block.nNonce);
  29. printf("block.GetHash = %s\n", block.GetHash().ToString().c_str());
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement