S
S
Slaxik2018-08-06 01:03:24
linux
Slaxik, 2018-08-06 01:03:24

Problem with operator >?

if (true && genesis.GetHash() != consensus.hashGenesisBlock)
        {
            printf("recalculating params for mainnet.\n");
            printf("genesis.nNonce = %s\n", genesis.nNonce);
            printf("old mainnet genesis hash:  %s\n", consensus.hashGenesisBlock.ToString().c_str());
            // deliberately empty for loop finds nonce value.
            for(genesis.nNonce == 0; genesis.GetHash() > consensus.powLimit; genesis.nNonce++){ } 
            printf("new mainnet genesis merkle root: %s\n", genesis.hashMerkleRoot.ToString().c_str());
            printf("genesis.nNonce = %s\n", genesis.nNonce);
            printf("new mainnet genesis hash: %s\n", genesis.GetHash().ToString().c_str());
        }

Swears I can't figure out why
error: no match for 'operator>' (operand types are 'uint256' and 'uint256')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2018-08-06
@Slaksik

Apparently uint256 doesn't have such an operator. Proof https://github.com/bitcoin/bitcoin/blob/master/src...
But from this code you can understand that it has an operator<. You can use it, or define operator> in an obvious way

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question