27
27
#include < script/descriptor.h>
28
28
#include < script/script.h>
29
29
#include < script/signingprovider.h>
30
- #include < shutdown.h>
31
30
#include < timedata.h>
32
31
#include < txmempool.h>
33
32
#include < univalue.h>
@@ -129,11 +128,11 @@ static bool GenerateBlock(ChainstateManager& chainman, CBlock& block, uint64_t&
129
128
block_out.reset ();
130
129
block.hashMerkleRoot = BlockMerkleRoot (block);
131
130
132
- while (max_tries > 0 && block.nNonce < std::numeric_limits<uint32_t >::max () && !CheckProofOfWork (block.GetHash (), block.nBits , chainman.GetConsensus ()) && !ShutdownRequested () ) {
131
+ while (max_tries > 0 && block.nNonce < std::numeric_limits<uint32_t >::max () && !CheckProofOfWork (block.GetHash (), block.nBits , chainman.GetConsensus ()) && !chainman. m_interrupt ) {
133
132
++block.nNonce ;
134
133
--max_tries;
135
134
}
136
- if (max_tries == 0 || ShutdownRequested () ) {
135
+ if (max_tries == 0 || chainman. m_interrupt ) {
137
136
return false ;
138
137
}
139
138
if (block.nNonce == std::numeric_limits<uint32_t >::max ()) {
@@ -154,7 +153,7 @@ static bool GenerateBlock(ChainstateManager& chainman, CBlock& block, uint64_t&
154
153
static UniValue generateBlocks (ChainstateManager& chainman, const CTxMemPool& mempool, const CScript& coinbase_script, int nGenerate, uint64_t nMaxTries)
155
154
{
156
155
UniValue blockHashes (UniValue::VARR);
157
- while (nGenerate > 0 && !ShutdownRequested () ) {
156
+ while (nGenerate > 0 && !chainman. m_interrupt ) {
158
157
std::unique_ptr<CBlockTemplate> pblocktemplate (BlockAssembler{chainman.ActiveChainstate (), &mempool}.CreateNewBlock (coinbase_script));
159
158
if (!pblocktemplate.get ())
160
159
throw JSONRPCError (RPC_INTERNAL_ERROR, " Couldn't create new block" );
0 commit comments