Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/mining.cpp
Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | while (nHeight < nHeightEnd && !ShutdownRequested()) { | ||||
if (!pblocktemplate.get()) { | if (!pblocktemplate.get()) { | ||||
throw JSONRPCError(RPC_INTERNAL_ERROR, "Couldn't create new block"); | throw JSONRPCError(RPC_INTERNAL_ERROR, "Couldn't create new block"); | ||||
} | } | ||||
CBlock *pblock = &pblocktemplate->block; | CBlock *pblock = &pblocktemplate->block; | ||||
{ | { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
IncrementExtraNonce(config, pblock, chainActive.Tip(), nExtraNonce); | IncrementExtraNonce(pblock, chainActive.Tip(), | ||||
config.GetMaxBlockSize(), nExtraNonce); | |||||
} | } | ||||
while (nMaxTries > 0 && pblock->nNonce < nInnerLoopCount && | while (nMaxTries > 0 && pblock->nNonce < nInnerLoopCount && | ||||
!CheckProofOfWork(pblock->GetHash(), pblock->nBits, | !CheckProofOfWork(pblock->GetHash(), pblock->nBits, | ||||
config.GetChainParams().GetConsensus())) { | config.GetChainParams().GetConsensus())) { | ||||
++pblock->nNonce; | ++pblock->nNonce; | ||||
--nMaxTries; | --nMaxTries; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 682 Lines • Show Last 20 Lines |