Skip to content

Commit 0e2c963

Browse files
committed
Merge 7d7b832 into merged_master (Bitcoin PR #16262)
2 parents 5faac4d + 7d7b832 commit 0e2c963

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/rpc/mining.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ static UniValue getnetworkhashps(const JSONRPCRequest& request)
110110

111111
static UniValue generateBlocks(const CScript& coinbase_script, int nGenerate, uint64_t nMaxTries)
112112
{
113-
static const int nInnerLoopCount = 0x10000;
114113
int nHeightEnd = 0;
115114
int nHeight = 0;
116115

@@ -134,14 +133,14 @@ static UniValue generateBlocks(const CScript& coinbase_script, int nGenerate, ui
134133
// Signed blocks have no PoW requirements, but merkle root computed above in
135134
// IncrementExtraNonce
136135
if (!g_signed_blocks) {
137-
while (nMaxTries > 0 && pblock->nNonce < nInnerLoopCount && !CheckProofOfWork(pblock->GetHash(), pblock->nBits, Params().GetConsensus())) {
136+
while (nMaxTries > 0 && pblock->nNonce < std::numeric_limits<uint32_t>::max() && !CheckProofOfWork(pblock->GetHash(), pblock->nBits, Params().GetConsensus()) && !ShutdownRequested()) {
138137
++pblock->nNonce;
139138
--nMaxTries;
140139
}
141140
if (nMaxTries == 0) {
142141
break;
143142
}
144-
if (pblock->nNonce == nInnerLoopCount) {
143+
if (pblock->nNonce == std::numeric_limits<uint32_t>::max()) {
145144
continue;
146145
}
147146
}

0 commit comments

Comments
 (0)