Skip to content

Commit

Permalink
Merge 7d7b832 into merged_master (Bitcoin PR #16262)
Browse files Browse the repository at this point in the history
  • Loading branch information
apoelstra committed Nov 9, 2020
2 parents 5faac4d + 7d7b832 commit 0e2c963
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ static UniValue getnetworkhashps(const JSONRPCRequest& request)

static UniValue generateBlocks(const CScript& coinbase_script, int nGenerate, uint64_t nMaxTries)
{
static const int nInnerLoopCount = 0x10000;
int nHeightEnd = 0;
int nHeight = 0;

Expand All @@ -134,14 +133,14 @@ static UniValue generateBlocks(const CScript& coinbase_script, int nGenerate, ui
// Signed blocks have no PoW requirements, but merkle root computed above in
// IncrementExtraNonce
if (!g_signed_blocks) {
while (nMaxTries > 0 && pblock->nNonce < nInnerLoopCount && !CheckProofOfWork(pblock->GetHash(), pblock->nBits, Params().GetConsensus())) {
while (nMaxTries > 0 && pblock->nNonce < std::numeric_limits<uint32_t>::max() && !CheckProofOfWork(pblock->GetHash(), pblock->nBits, Params().GetConsensus()) && !ShutdownRequested()) {
++pblock->nNonce;
--nMaxTries;
}
if (nMaxTries == 0) {
break;
}
if (pblock->nNonce == nInnerLoopCount) {
if (pblock->nNonce == std::numeric_limits<uint32_t>::max()) {
continue;
}
}
Expand Down

0 comments on commit 0e2c963

Please sign in to comment.