aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/mining.cpp
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2017-06-04 22:45:22 +0200
committerpracticalswift <practicalswift@users.noreply.github.com>2017-06-05 00:52:36 +0200
commit90593ed92cfd5d49900a6fb6c2c10a482ab9fdbb (patch)
tree1f830a3679ef00b774dc8ac6b216366f2ed52a68 /src/rpc/mining.cpp
parentf259263a7b11c6ff925851985ef0082b0a190a57 (diff)
downloadbitcoin-90593ed92cfd5d49900a6fb6c2c10a482ab9fdbb.tar.xz
Limit variable scope
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 d744269df1..c6903b8316 100644
--- a/src/rpc/mining.cpp
+++ b/src/rpc/mining.cpp
@@ -98,15 +98,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);