user75419: Im trying to clone a coin and I created a genesis block but when I run the wallet, it dosent start.. When I go to the log file, I see this error and I honestly dont know how to solve the problem. How do I create the genesis block for the quark-hash algorithm.. I tried some generators and it didnt work. Any help would be appreciated.
This is from the debug.log file...
ERROR: CheckProofOfWork() : hash doesn't match nBits
ERROR: CheckBlockHeader() : proof of work failed
ERROR: CheckBlock() : CheckBlockHeader failed
ERROR: ConnectTip() : ConnectBlock 7451cc25dd4fdfc6f441298e59dfc012d2dc078d687a120bf94a20d98beefd16 failed

user75419: Ok so im cloning BitcoinGreen... It uses Quark Algorithm. The way I generate the genesis block & MerkleRoot is by pasting the code on the chainparams.cpp which is this..
printf("genesis.GetHash = %s\n", genesis.GetHash().ToString().c_str());
printf("Gensis Hash Merkle: %s\n", genesis.hashMerkleRoot.ToString().c_str());
Even tho this gave me the code to the genesis block, it did not generate the correct code for the coin. I even use this special code, which generate the genesis block as well...
const int SCRYPT_SCRATCHPAD_SIZE = 131072 + 63;
      //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 time\n");
                ++genesis.nTime;
            }
        }
        printf("block.nTime = %u \n", genesis.nTime);
        printf("block.nNonce = %u \n", genesis.nNonce);
        printf("block.GetHash = %s\n", genesis.GetHash().ToString().c_str());

        }

This also did not work. So thats pretty much it. I tried.

75419: <p>Im trying to clone a coin and I created a genesis block but when I run the wallet, it dosent start.. When I go to the log file, I see this error and I honestly dont know how to solve the problem. How do I create the genesis block for the quark-hash algorithm.. I tried some generators and it didnt work. Any help would be appreciated.</p>

<p>This is from the debug.log file...</p>

<p>ERROR: CheckProofOfWork() : hash doesn't match nBits
ERROR: CheckBlockHeader() : proof of work failed
ERROR: CheckBlock() : CheckBlockHeader failed
ERROR: ConnectTip() : ConnectBlock 7451cc25dd4fdfc6f441298e59dfc012d2dc078d687a120bf94a20d98beefd16 failed</p>
 75419: <p>Ok so im cloning BitcoinGreen... It uses Quark Algorithm. The way I generate the genesis block &amp; MerkleRoot is by pasting the code on the chainparams.cpp which is this..</p>

<p>printf("genesis.GetHash = %s\n", genesis.GetHash().ToString().c_str());</p>

<p>printf("Gensis Hash Merkle: %s\n", genesis.hashMerkleRoot.ToString().c_str());</p>

<p>Even tho this gave me the code to the genesis block, it did not generate the correct code for the coin. I even use this special code, which generate the genesis block as well...</p>

<p>const int SCRYPT_SCRATCHPAD_SIZE = 131072 + 63;</p>

<pre><code>      //if (true &amp;&amp; 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 &lt;= hashTarget)
                break;
            if ((genesis.nNonce &amp; 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 time\n");
                ++genesis.nTime;
            }
        }
        printf("block.nTime = %u \n", genesis.nTime);
        printf("block.nNonce = %u \n", genesis.nNonce);
        printf("block.GetHash = %s\n", genesis.GetHash().ToString().c_str());

        }
</code></pre>

<p>This also did not work. So thats pretty much it. I tried.</p>
