aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/mining.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-06-09 12:58:02 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-06-09 13:09:24 -0700
commit76f268b9bd1b69eb7784c5324abbb67f3e395b97 (patch)
tree3871ee223344c98c30939645dfa5fd4ff9128d7e /src/rpc/mining.cpp
parent29f80cd230c38d7e424810e986c160ddba9b53ac (diff)
parent90593ed92cfd5d49900a6fb6c2c10a482ab9fdbb (diff)
downloadbitcoin-76f268b9bd1b69eb7784c5324abbb67f3e395b97.tar.xz
Merge #10521: Limit variable scope
90593ed92 Limit variable scope (practicalswift) Tree-SHA512: 4719e303688a31aefbe1d239e86b21dd3c2045524e08bd628c6ba0c6c2a97de14d04305b9beafe0b1dcde7229793e6663168953f192e88ed409be5c30fd2a9a9
Diffstat (limited to 'src/rpc/mining.cpp')
-rw-r--r--src/rpc/mining.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp
index d8c4702346..b9093579e3 100644
--- a/src/rpc/mining.cpp
+++ b/src/rpc/mining.cpp
@@ -96,15 +96,13 @@ UniValue getnetworkhashps(const JSONRPCRequest& request)
UniValue generateBlocks(std::shared_ptr<CReserveScript> coinbaseScript, int nGenerate, uint64_t nMaxTries, bool keepScript)
{
static const int nInnerLoopCount = 0x10000;
- int nHeightStart = 0;
int nHeightEnd = 0;
int nHeight = 0;
{ // Don't keep cs_main locked
LOCK(cs_main);
- nHeightStart = chainActive.Height();
- nHeight = nHeightStart;
- nHeightEnd = nHeightStart+nGenerate;
+ nHeight = chainActive.Height();
+ nHeightEnd = nHeight+nGenerate;
}
unsigned int nExtraNonce = 0;
UniValue blockHashes(UniValue::VARR);