aboutsummaryrefslogtreecommitdiff
path: root/src/addrman.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/addrman.cpp')
-rw-r--r--src/addrman.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/addrman.cpp b/src/addrman.cpp
index a56bb4f9c1..9eefffb45b 100644
--- a/src/addrman.cpp
+++ b/src/addrman.cpp
@@ -1,13 +1,13 @@
// Copyright (c) 2012 Pieter Wuille
-// Copyright (c) 2012-2016 The Bitcoin Core developers
+// Copyright (c) 2012-2017 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#include "addrman.h"
+#include <addrman.h>
-#include "hash.h"
-#include "serialize.h"
-#include "streams.h"
+#include <hash.h>
+#include <serialize.h>
+#include <streams.h>
int CAddrInfo::GetTriedBucket(const uint256& nKey) const
{
@@ -387,12 +387,12 @@ int CAddrMan::Check_()
std::set<int> setTried;
std::map<int, int> mapNew;
- if (vRandom.size() != nTried + nNew)
+ if (vRandom.size() != (size_t)(nTried + nNew))
return -7;
- for (std::map<int, CAddrInfo>::iterator it = mapInfo.begin(); it != mapInfo.end(); it++) {
- int n = (*it).first;
- CAddrInfo& info = (*it).second;
+ for (const auto& entry : mapInfo) {
+ int n = entry.first;
+ const CAddrInfo& info = entry.second;
if (info.fInTried) {
if (!info.nLastSuccess)
return -1;
@@ -408,7 +408,7 @@ int CAddrMan::Check_()
}
if (mapAddr[info] != n)
return -5;
- if (info.nRandomPos < 0 || info.nRandomPos >= vRandom.size() || vRandom[info.nRandomPos] != n)
+ if (info.nRandomPos < 0 || (size_t)info.nRandomPos >= vRandom.size() || vRandom[info.nRandomPos] != n)
return -14;
if (info.nLastTry < 0)
return -6;
@@ -416,9 +416,9 @@ int CAddrMan::Check_()
return -8;
}
- if (setTried.size() != nTried)
+ if (setTried.size() != (size_t)nTried)
return -9;
- if (mapNew.size() != nNew)
+ if (mapNew.size() != (size_t)nNew)
return -10;
for (int n = 0; n < ADDRMAN_TRIED_BUCKET_COUNT; n++) {