Mercurial > hg > bitcoin
changeset 2891:c3ce6eebff40 draft
fix warnings: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
author | Wladimir J. van der Laan <laanwj@gmail.com> |
---|---|
date | Sun, 15 Apr 2012 13:27:00 +0200 |
parents | f08ae998dfd0 |
children | 162e3fdffc98 |
files | src/bitcoinrpc.cpp src/db.cpp src/main.cpp src/main.h src/wallet.cpp src/wallet.h |
diffstat | 6 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -802,8 +802,10 @@ list<pair<CBitcoinAddress, int64> > listSent; wtx.GetAmounts(allGeneratedImmature, allGeneratedMature, listReceived, listSent, allFee, strSentAccount); if (wtx.GetDepthInMainChain() >= nMinDepth) + { BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress,int64)& r, listReceived) nBalance += r.second; + } BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress,int64)& r, listSent) nBalance -= r.second; nBalance -= allFee; @@ -1236,6 +1238,7 @@ // Received if (listReceived.size() > 0 && wtx.GetDepthInMainChain() >= nMinDepth) + { BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, int64)& r, listReceived) { string account; @@ -1253,6 +1256,7 @@ ret.push_back(entry); } } + } } void AcentryToJSON(const CAccountingEntry& acentry, const string& strAccount, Array& ret)
--- a/src/db.cpp +++ b/src/db.cpp @@ -647,6 +647,7 @@ // check level 4: check whether spent txouts were spent within the main chain int nOutput = 0; if (nCheckLevel>3) + { BOOST_FOREACH(const CDiskTxPos &txpos, txindex.vSpent) { if (!txpos.IsNull()) @@ -687,9 +688,11 @@ } nOutput++; } + } } // check level 5: check whether all prevouts are marked spent if (nCheckLevel>4) + { BOOST_FOREACH(const CTxIn &txin, tx.vin) { CTxIndex txindex; @@ -700,6 +703,7 @@ pindexFork = pindex->pprev; } } + } } } }
--- a/src/main.cpp +++ b/src/main.cpp @@ -1269,14 +1269,18 @@ // This rule applies to all blocks whose timestamp is after March 15, 2012, 0:00 UTC. // On testnet it is enabled as of februari 20, 2012, 0:00 UTC. if (pindex->nTime > 1331769600 || (fTestNet && pindex->nTime > 1329696000)) + { BOOST_FOREACH(CTransaction& tx, vtx) { CTxIndex txindexOld; if (txdb.ReadTxIndex(tx.GetHash(), txindexOld)) + { BOOST_FOREACH(CDiskTxPos &pos, txindexOld.vSpent) if (pos.IsNull()) return false; + } } + } // BIP16 didn't become active until Apr 1 2012 (Feb 15 on testnet) int64 nBIP16SwitchTime = fTestNet ? 1329264000 : 1333238400;
--- a/src/main.h +++ b/src/main.h @@ -572,9 +572,11 @@ // To limit dust spam, require MIN_TX_FEE/MIN_RELAY_TX_FEE if any output is less than 0.01 if (nMinFee < nBaseFee) + { BOOST_FOREACH(const CTxOut& txout, vout) if (txout.nValue < CENT) nMinFee = nBaseFee; + } // Raise the price as the block approaches full if (nBlockSize != 1 && nNewBlockSize >= MAX_BLOCK_SIZE_GEN/2)