mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
Fix loop index var types, fixing many minor sign comparison warnings
foo.size() typically returns an unsigned integral type; make loop variables match those types' signedness.
This commit is contained in:
@@ -615,7 +615,7 @@ void CWalletTx::AddSupportingTransactions(CTxDB& txdb)
|
||||
LOCK(pwallet->cs_wallet);
|
||||
map<uint256, const CMerkleTx*> mapWalletPrev;
|
||||
set<uint256> setAlreadyDone;
|
||||
for (int i = 0; i < vWorkQueue.size(); i++)
|
||||
for (unsigned int i = 0; i < vWorkQueue.size(); i++)
|
||||
{
|
||||
uint256 hash = vWorkQueue[i];
|
||||
if (setAlreadyDone.count(hash))
|
||||
@@ -723,7 +723,7 @@ void CWallet::ReacceptWalletTransactions()
|
||||
printf("ERROR: ReacceptWalletTransactions() : txindex.vSpent.size() %d != wtx.vout.size() %d\n", txindex.vSpent.size(), wtx.vout.size());
|
||||
continue;
|
||||
}
|
||||
for (int i = 0; i < txindex.vSpent.size(); i++)
|
||||
for (unsigned int i = 0; i < txindex.vSpent.size(); i++)
|
||||
{
|
||||
if (wtx.IsSpent(i))
|
||||
continue;
|
||||
@@ -902,7 +902,7 @@ bool CWallet::SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfThe
|
||||
if (nDepth < (pcoin->IsFromMe() ? nConfMine : nConfTheirs))
|
||||
continue;
|
||||
|
||||
for (int i = 0; i < pcoin->vout.size(); i++)
|
||||
for (unsigned int i = 0; i < pcoin->vout.size(); i++)
|
||||
{
|
||||
if (pcoin->IsSpent(i) || !IsMine(pcoin->vout[i]))
|
||||
continue;
|
||||
@@ -935,7 +935,7 @@ bool CWallet::SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfThe
|
||||
|
||||
if (nTotalLower == nTargetValue || nTotalLower == nTargetValue + CENT)
|
||||
{
|
||||
for (int i = 0; i < vValue.size(); ++i)
|
||||
for (unsigned int i = 0; i < vValue.size(); ++i)
|
||||
{
|
||||
setCoinsRet.insert(vValue[i].second);
|
||||
nValueRet += vValue[i].first;
|
||||
@@ -968,7 +968,7 @@ bool CWallet::SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfThe
|
||||
bool fReachedTarget = false;
|
||||
for (int nPass = 0; nPass < 2 && !fReachedTarget; nPass++)
|
||||
{
|
||||
for (int i = 0; i < vValue.size(); i++)
|
||||
for (unsigned int i = 0; i < vValue.size(); i++)
|
||||
{
|
||||
if (nPass == 0 ? rand() % 2 : !vfIncluded[i])
|
||||
{
|
||||
@@ -997,7 +997,7 @@ bool CWallet::SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfThe
|
||||
nValueRet += coinLowestLarger.first;
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < vValue.size(); i++)
|
||||
for (unsigned int i = 0; i < vValue.size(); i++)
|
||||
if (vfBest[i])
|
||||
{
|
||||
setCoinsRet.insert(vValue[i].second);
|
||||
@@ -1006,7 +1006,7 @@ bool CWallet::SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfThe
|
||||
|
||||
//// debug print
|
||||
printf("SelectCoins() best subset: ");
|
||||
for (int i = 0; i < vValue.size(); i++)
|
||||
for (unsigned int i = 0; i < vValue.size(); i++)
|
||||
if (vfBest[i])
|
||||
printf("%s ", FormatMoney(vValue[i].first).c_str());
|
||||
printf("total %s\n", FormatMoney(nBest).c_str());
|
||||
|
||||
Reference in New Issue
Block a user