mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Use arith_uint256 where necessary
Also add conversion from/to uint256 where needed.
This commit is contained in:
@@ -481,7 +481,7 @@ void static BitcoinMiner(CWallet *pwallet)
|
||||
// Search
|
||||
//
|
||||
int64_t nStart = GetTime();
|
||||
uint256 hashTarget = uint256().SetCompact(pblock->nBits);
|
||||
arith_uint256 hashTarget = arith_uint256().SetCompact(pblock->nBits);
|
||||
uint256 hash;
|
||||
uint32_t nNonce = 0;
|
||||
uint32_t nOldNonce = 0;
|
||||
@@ -493,7 +493,7 @@ void static BitcoinMiner(CWallet *pwallet)
|
||||
// Check if something found
|
||||
if (fFound)
|
||||
{
|
||||
if (hash <= hashTarget)
|
||||
if (UintToArith256(hash) <= hashTarget)
|
||||
{
|
||||
// Found a solution
|
||||
pblock->nNonce = nNonce;
|
||||
|
||||
Reference in New Issue
Block a user