diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-03-30 11:40:45 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-03-30 11:40:46 -0400 |
commit | be299c4a4725442f37a4dca27bcae31546d6d8dd (patch) | |
tree | f0e3b8a79fdafb31fa902ef12933c3522705ee62 /src | |
parent | 5e53b80b0280e6c564fc812188a838ce5889d86c (diff) | |
parent | 6a318e48a67a8f9834e14c960bd4f5b6e295b2dc (diff) |
Merge #12780: Reduce variable scopes
6a318e48a6 Reduce variable scopes (practicalswift)
Pull request description:
Reduce variable scopes.
Tree-SHA512: 5c7735344024cb6cd310e739886dc811a64b640a0d6aac8b3d04f49e5987d6ff6676d978890bc84f1460527d92217176a79b007f0bf6b4147c04abfec2c67714
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/recentrequeststablemodel.cpp | 3 | ||||
-rw-r--r-- | src/test/test_bitcoin.cpp | 2 | ||||
-rw-r--r-- | src/test/util_tests.cpp | 3 |
3 files changed, 3 insertions, 5 deletions
diff --git a/src/qt/recentrequeststablemodel.cpp b/src/qt/recentrequeststablemodel.cpp index 0dd7d46960..f045053c3b 100644 --- a/src/qt/recentrequeststablemodel.cpp +++ b/src/qt/recentrequeststablemodel.cpp @@ -139,10 +139,9 @@ bool RecentRequestsTableModel::removeRows(int row, int count, const QModelIndex if(count > 0 && row >= 0 && (row+count) <= list.size()) { - const RecentRequestEntry *rec; for (int i = 0; i < count; ++i) { - rec = &list[row+i]; + const RecentRequestEntry* rec = &list[row+i]; if (!walletModel->saveReceiveRequest(rec->recipient.address.toStdString(), rec->id, "")) return false; } 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<CMutableTransaction>& 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: |