Last active
August 29, 2015 14:06
-
-
Save philsong/ce9b368a51e4ae7aa6e1 to your computer and use it in GitHub Desktop.
计算符合pow要求的最小值
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CBlock block; | |
block.nNonce = 2084731820; | |
block.vtx.push_back(txNew); | |
block.hashPrevBlock = 0; | |
block.hashMerkleRoot = block.BuildMerkleTree(); | |
block.nVersion = 1; | |
block.nTime = 1409745976; | |
block.nBits = 0x1e0ffff0; | |
#if 1 | |
while(1){ | |
if( CheckProofOfWork(block.GetPoWHash(), block.nBits) ){ | |
printf("find nNonce %ld\n", block.nNonce); | |
break; | |
}else{ | |
block.nNonce+=1; | |
} | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment