2727#include < script/descriptor.h>
2828#include < script/script.h>
2929#include < script/signingprovider.h>
30- #include < shutdown.h>
3130#include < timedata.h>
3231#include < txmempool.h>
3332#include < univalue.h>
@@ -129,11 +128,11 @@ static bool GenerateBlock(ChainstateManager& chainman, CBlock& block, uint64_t&
129128 block_out.reset ();
130129 block.hashMerkleRoot = BlockMerkleRoot (block);
131130
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 ) {
133132 ++block.nNonce ;
134133 --max_tries;
135134 }
136- if (max_tries == 0 || ShutdownRequested () ) {
135+ if (max_tries == 0 || chainman. m_interrupt ) {
137136 return false ;
138137 }
139138 if (block.nNonce == std::numeric_limits<uint32_t >::max ()) {
@@ -154,7 +153,7 @@ static bool GenerateBlock(ChainstateManager& chainman, CBlock& block, uint64_t&
154153static UniValue generateBlocks (ChainstateManager& chainman, const CTxMemPool& mempool, const CScript& coinbase_script, int nGenerate, uint64_t nMaxTries)
155154{
156155 UniValue blockHashes (UniValue::VARR);
157- while (nGenerate > 0 && !ShutdownRequested () ) {
156+ while (nGenerate > 0 && !chainman. m_interrupt ) {
158157 std::unique_ptr<CBlockTemplate> pblocktemplate (BlockAssembler{chainman.ActiveChainstate (), &mempool}.CreateNewBlock (coinbase_script));
159158 if (!pblocktemplate.get ())
160159 throw JSONRPCError (RPC_INTERNAL_ERROR, " Couldn't create new block" );
0 commit comments