Skip to content

Commit abc677c

Browse files
committed
Merge #8191: Do not shadow variables in src/wallet
b175cb7 Do not shadow variables. (Pavel Janík)
2 parents 5cac8b1 + b175cb7 commit abc677c

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/wallet/db.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,11 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip)
387387
while (fSuccess) {
388388
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
389389
CDataStream ssValue(SER_DISK, CLIENT_VERSION);
390-
int ret = db.ReadAtCursor(pcursor, ssKey, ssValue);
391-
if (ret == DB_NOTFOUND) {
390+
int ret1 = db.ReadAtCursor(pcursor, ssKey, ssValue);
391+
if (ret1 == DB_NOTFOUND) {
392392
pcursor->close();
393393
break;
394-
} else if (ret != 0) {
394+
} else if (ret1 != 0) {
395395
pcursor->close();
396396
fSuccess = false;
397397
break;

src/wallet/rpcwallet.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,10 +1176,10 @@ UniValue ListReceived(const UniValue& params, bool fByAccounts)
11761176

11771177
if (fByAccounts)
11781178
{
1179-
tallyitem& item = mapAccountTally[strAccount];
1180-
item.nAmount += nAmount;
1181-
item.nConf = min(item.nConf, nConf);
1182-
item.fIsWatchonly = fIsWatchonly;
1179+
tallyitem& _item = mapAccountTally[strAccount];
1180+
_item.nAmount += nAmount;
1181+
_item.nConf = min(_item.nConf, nConf);
1182+
_item.fIsWatchonly = fIsWatchonly;
11831183
}
11841184
else
11851185
{
@@ -1195,9 +1195,9 @@ UniValue ListReceived(const UniValue& params, bool fByAccounts)
11951195
UniValue transactions(UniValue::VARR);
11961196
if (it != mapTally.end())
11971197
{
1198-
BOOST_FOREACH(const uint256& item, (*it).second.txids)
1198+
BOOST_FOREACH(const uint256& _item, (*it).second.txids)
11991199
{
1200-
transactions.push_back(item.GetHex());
1200+
transactions.push_back(_item.GetHex());
12011201
}
12021202
}
12031203
obj.push_back(Pair("txids", transactions));

src/wallet/test/wallet_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ BOOST_AUTO_TEST_CASE(coin_selection_tests)
217217
// run the 'mtgox' test (see http://blockexplorer.com/tx/29a3efd3ef04f9153d47a990bd7b048a4b2d213daaa5fb8ed670fb85f13bdbcf)
218218
// they tried to consolidate 10 50k coins into one 500k coin, and ended up with 50k in change
219219
empty_wallet();
220-
for (int i = 0; i < 20; i++)
220+
for (int j = 0; j < 20; j++)
221221
add_coin(50000 * COIN);
222222

223223
BOOST_CHECK( wallet.SelectCoinsMinConf(500000 * COIN, 1, 1, vCoins, setCoinsRet, nValueRet));
@@ -296,7 +296,7 @@ BOOST_AUTO_TEST_CASE(coin_selection_tests)
296296
BOOST_CHECK(!equal_sets(setCoinsRet, setCoinsRet2));
297297

298298
int fails = 0;
299-
for (int i = 0; i < RANDOM_REPEATS; i++)
299+
for (int j = 0; j < RANDOM_REPEATS; j++)
300300
{
301301
// selecting 1 from 100 identical coins depends on the shuffle; this test will fail 1% of the time
302302
// run the test RANDOM_REPEATS times and only complain if all of them fail
@@ -317,7 +317,7 @@ BOOST_AUTO_TEST_CASE(coin_selection_tests)
317317
add_coin(25 * CENT);
318318

319319
fails = 0;
320-
for (int i = 0; i < RANDOM_REPEATS; i++)
320+
for (int j = 0; j < RANDOM_REPEATS; j++)
321321
{
322322
// selecting 1 from 100 identical coins depends on the shuffle; this test will fail 1% of the time
323323
// run the test RANDOM_REPEATS times and only complain if all of them fail

src/wallet/walletdb.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -887,8 +887,8 @@ void ThreadFlushWalletDB(const string& strFile)
887887
if (nRefCount == 0)
888888
{
889889
boost::this_thread::interruption_point();
890-
map<string, int>::iterator mi = bitdb.mapFileUseCount.find(strFile);
891-
if (mi != bitdb.mapFileUseCount.end())
890+
map<string, int>::iterator _mi = bitdb.mapFileUseCount.find(strFile);
891+
if (_mi != bitdb.mapFileUseCount.end())
892892
{
893893
LogPrint("db", "Flushing %s\n", strFile);
894894
nLastFlushed = nWalletDBUpdated;
@@ -898,7 +898,7 @@ void ThreadFlushWalletDB(const string& strFile)
898898
bitdb.CloseDb(strFile);
899899
bitdb.CheckpointLSN(strFile);
900900

901-
bitdb.mapFileUseCount.erase(mi++);
901+
bitdb.mapFileUseCount.erase(_mi++);
902902
LogPrint("db", "Flushed %s %dms\n", strFile, GetTimeMillis() - nStart);
903903
}
904904
}

0 commit comments

Comments
 (0)