aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2017-05-18 09:42:14 +0200
committerpracticalswift <practicalswift@users.noreply.github.com>2017-05-19 09:56:16 +0200
commit211adc074a662505f2b54f3f2755f4fefc167aac (patch)
tree75ae8f49fcd201cc359664317df049f04c78c41b /src/net_processing.cpp
parentea6fde3f1d2694176a657b69fb0eeb5426e6f309 (diff)
downloadbitcoin-211adc074a662505f2b54f3f2755f4fefc167aac.tar.xz
Use range-based for loops (C++11) when looping over vector elements
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index aca88f2660..3102c2ef9a 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -754,8 +754,8 @@ void PeerLogicValidation::BlockConnected(const std::shared_ptr<const CBlock>& pb
const CTransaction& tx = *ptx;
// Which orphan pool entries must we evict?
- for (size_t j = 0; j < tx.vin.size(); j++) {
- auto itByPrev = mapOrphanTransactionsByPrev.find(tx.vin[j].prevout);
+ for (const auto& txin : tx.vin) {
+ auto itByPrev = mapOrphanTransactionsByPrev.find(txin.prevout);
if (itByPrev == mapOrphanTransactionsByPrev.end()) continue;
for (auto mi = itByPrev->second.begin(); mi != itByPrev->second.end(); ++mi) {
const CTransaction& orphanTx = *(*mi)->second.tx;
@@ -1553,10 +1553,8 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
uint32_t nFetchFlags = GetFetchFlags(pfrom);
- for (unsigned int nInv = 0; nInv < vInv.size(); nInv++)
+ for (CInv &inv : vInv)
{
- CInv &inv = vInv[nInv];
-
if (interruptMsgProc)
return true;