View difference between Paste ID: 6Ju0Z104 and du2XdxCC
SHOW: | | - or go back to the newest paste.
1
date +%s
2
3
if (false && block.GetHash() != hashGenesisBlock)
4
        {
5
            printf("Searching for genesis block...\n");
6
            // This will figure out a valid hash and Nonce if you're
7
            // creating a different genesis block:
8
            uint256 hashTarget = CBigNum().SetCompact(block.nBits).getuint256();
9
            uint256 thash;
10
            char scratchpad[SCRYPT_SCRATCHPAD_SIZE];
11
12
            loop
13
            {
14
#if defined(USE_SSE2)
15
                // Detection would work, but in cases where we KNOW it always has SSE2,
16
                // it is faster to use directly than to use a function pointer or conditional.
17
#if defined(_M_X64) || defined(__x86_64__) || defined(_M_AMD64) || (defined(MAC_OSX) && defined(__i386__))
18
                // Always SSE2: x86_64 or Intel MacOS X
19
                scrypt_1024_1_1_256_sp_sse2(BEGIN(block.nVersion), BEGIN(thash), scratchpad);
20
#else
21
                // Detect SSE2: 32bit x86 Linux or Windows
22
                scrypt_1024_1_1_256_sp(BEGIN(block.nVersion), BEGIN(thash), scratchpad);
23
#endif
24
#else
25
                // Generic scrypt
26
                scrypt_1024_1_1_256_sp_generic(BEGIN(block.nVersion), BEGIN(thash), scratchpad);
27
#endif
28
                if (thash <= hashTarget)
29
                    break;
30
                if ((block.nNonce & 0xFFF) == 0)
31
                {
32
                    printf("nonce %08X: hash = %s (target = %s)\n", block.nNonce, thash.ToString().c_str(), hashTarget.ToString().c_str());
33
                }
34
                ++block.nNonce;
35
                if (block.nNonce == 0)
36
                {
37
                    printf("NONCE WRAPPED, incrementing time\n");
38
                    ++block.nTime;
39
                }
40
            }
41
            printf("block.nTime = %u \n", block.nTime);
42
            printf("block.nNonce = %u \n", block.nNonce);
43
            printf("block.GetHash = %s\n", block.GetHash().ToString().c_str());
44
        }