aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-04-23 17:52:26 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-04-23 18:04:52 +0200
commit84efa9a0f7525637e09ad3dacc1ef5afefd509b3 (patch)
treeb9c6af6bd7519e7b956e5cbb3756f4eadb762ddf /src
parentd1e3c5e73cfc84c1e0f89784c309dab557063bb7 (diff)
parent0851a75b5aad7b05a1cfb4a285ddc9e3319f887b (diff)
downloadbitcoin-84efa9a0f7525637e09ad3dacc1ef5afefd509b3.tar.xz
Merge #12448: Interrupt block generation on shutdown request
0851a75 rpc: Interrupt block generation on shutdown request (João Barbosa) Pull request description: With this simple change, after running `bitcoin-cli -regtest generate 100000`, it is possible to interrupt `bitcoind` cleanly without waiting for the generation to complete. Tree-SHA512: f0f7cdde242e595cfdaea31ae8bddbc25933621b63f639e813d272c2b00ce2ef52f0c14ae44954ba8c49f0fc846bcc3bfd5419e52b3347a68bb0341ce6b02d26
Diffstat (limited to 'src')
-rw-r--r--src/rpc/mining.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp
index 9a7c4b8e6d..b4bb78e689 100644
--- a/src/rpc/mining.cpp
+++ b/src/rpc/mining.cpp
@@ -116,7 +116,7 @@ UniValue generateBlocks(std::shared_ptr<CReserveScript> coinbaseScript, int nGen
}
unsigned int nExtraNonce = 0;
UniValue blockHashes(UniValue::VARR);
- while (nHeight < nHeightEnd)
+ while (nHeight < nHeightEnd && !ShutdownRequested())
{
std::unique_ptr<CBlockTemplate> pblocktemplate(BlockAssembler(Params()).CreateNewBlock(coinbaseScript->reserveScript));
if (!pblocktemplate.get())