mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 7d7b832d67 into merged_master (Bitcoin PR #16262)
This commit is contained in:
commit
0e2c963dbf
1 changed files with 2 additions and 3 deletions
|
|
@ -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;
|
||||
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue