From 6a318e48a67a8f9834e14c960bd4f5b6e295b2dc Mon Sep 17 00:00:00 2001 From: practicalswift Date: Sun, 25 Mar 2018 22:49:33 +0200 Subject: Reduce variable scopes --- src/test/test_bitcoin.cpp | 2 +- src/test/util_tests.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/test') diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 95c4825b84..9390a93b99 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -145,9 +145,9 @@ TestChain100Setup::CreateAndProcessBlock(const std::vector& for (const CMutableTransaction& tx : txns) block.vtx.push_back(MakeTransactionRef(tx)); // IncrementExtraNonce creates a valid coinbase and merkleRoot - unsigned int extraNonce = 0; { LOCK(cs_main); + unsigned int extraNonce = 0; IncrementExtraNonce(&block, chainActive.Tip(), extraNonce); } diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index b6f3cbe2b7..b0c5c53016 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -704,9 +704,8 @@ static constexpr char ExitCommand = 'X'; static void TestOtherProcess(fs::path dirname, std::string lockname, int fd) { char ch; - int rv; while (true) { - rv = read(fd, &ch, 1); // Wait for command + int rv = read(fd, &ch, 1); // Wait for command assert(rv == 1); switch(ch) { case LockCommand: -- cgit v1.2.3