Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/mining.cpp
Show First 20 Lines • Show All 124 Lines • ▼ Show 20 Lines | int nHeight = 0; | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
nHeightStart = chainActive.Height(); | nHeightStart = chainActive.Height(); | ||||
nHeight = nHeightStart; | nHeight = nHeightStart; | ||||
nHeightEnd = nHeightStart + nGenerate; | nHeightEnd = nHeightStart + nGenerate; | ||||
} | } | ||||
unsigned int nExtraNonce = 0; | unsigned int nExtraNonce = 0; | ||||
UniValue blockHashes(UniValue::VARR); | UniValue blockHashes(UniValue::VARR); | ||||
while (nHeight < nHeightEnd) { | while (nHeight < nHeightEnd && !ShutdownRequested()) { | ||||
std::unique_ptr<CBlockTemplate> pblocktemplate( | std::unique_ptr<CBlockTemplate> pblocktemplate( | ||||
BlockAssembler(config, g_mempool) | BlockAssembler(config, g_mempool) | ||||
.CreateNewBlock(coinbaseScript->reserveScript)); | .CreateNewBlock(coinbaseScript->reserveScript)); | ||||
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"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 675 Lines • Show Last 20 Lines |