diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/addrman.cpp | 10 | ||||
-rw-r--r-- | src/addrman.h | 11 | ||||
-rw-r--r-- | src/init.cpp | 8 |
3 files changed, 14 insertions, 15 deletions
diff --git a/src/addrman.cpp b/src/addrman.cpp index 121ae4bf7e..2f8a3a0bd5 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -6,8 +6,8 @@ #include <addrman.h> #include <hash.h> -#include <serialize.h> #include <logging.h> +#include <serialize.h> int CAddrInfo::GetTriedBucket(const uint256& nKey, const std::vector<bool> &asmap) const { @@ -15,7 +15,7 @@ int CAddrInfo::GetTriedBucket(const uint256& nKey, const std::vector<bool> &asma uint64_t hash2 = (CHashWriter(SER_GETHASH, 0) << nKey << GetGroup(asmap) << (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP)).GetCheapHash(); int tried_bucket = hash2 % ADDRMAN_TRIED_BUCKET_COUNT; uint32_t mapped_as = GetMappedAS(asmap); - LogPrint(BCLog::NET, "IP %s mapped to AS%i belongs to tried bucket %i.\n", ToStringIP(), mapped_as, tried_bucket); + LogPrint(BCLog::NET, "IP %s mapped to AS%i belongs to tried bucket %i\n", ToStringIP(), mapped_as, tried_bucket); return tried_bucket; } @@ -26,7 +26,7 @@ int CAddrInfo::GetNewBucket(const uint256& nKey, const CNetAddr& src, const std: uint64_t hash2 = (CHashWriter(SER_GETHASH, 0) << nKey << vchSourceGroupKey << (hash1 % ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP)).GetCheapHash(); int new_bucket = hash2 % ADDRMAN_NEW_BUCKET_COUNT; uint32_t mapped_as = GetMappedAS(asmap); - LogPrint(BCLog::NET, "IP %s mapped to AS%i belongs to new bucket %i.\n", ToStringIP(), mapped_as, new_bucket); + LogPrint(BCLog::NET, "IP %s mapped to AS%i belongs to new bucket %i\n", ToStringIP(), mapped_as, new_bucket); return new_bucket; } @@ -630,12 +630,12 @@ std::vector<bool> CAddrMan::DecodeAsmap(fs::path path) FILE *filestr = fsbridge::fopen(path, "rb"); CAutoFile file(filestr, SER_DISK, CLIENT_VERSION); if (file.IsNull()) { - LogPrintf("Failed to open asmap file from disk.\n"); + LogPrintf("Failed to open asmap file from disk\n"); return bits; } fseek(filestr, 0, SEEK_END); int length = ftell(filestr); - LogPrintf("Opened asmap file %s (%d bytes) from disk.\n", path, length); + LogPrintf("Opened asmap file %s (%d bytes) from disk\n", path, length); fseek(filestr, 0, SEEK_SET); char cur_byte; for (int i = 0; i < length; ++i) { diff --git a/src/addrman.h b/src/addrman.h index 5901611bee..8e82020df0 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -6,23 +6,22 @@ #ifndef BITCOIN_ADDRMAN_H #define BITCOIN_ADDRMAN_H +#include <clientversion.h> #include <netaddress.h> #include <protocol.h> #include <random.h> #include <sync.h> #include <timedata.h> #include <util/system.h> -#include <clientversion.h> +#include <fs.h> +#include <hash.h> +#include <iostream> #include <map> #include <set> #include <stdint.h> -#include <vector> -#include <iostream> #include <streams.h> -#include <fs.h> -#include <hash.h> - +#include <vector> /** * Extended statistics about a CAddress diff --git a/src/init.cpp b/src/init.cpp index 0f56f3881c..d7a44d1d4c 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -47,11 +47,11 @@ #include <txdb.h> #include <txmempool.h> #include <ui_interface.h> +#include <util/asmap.h> #include <util/moneystr.h> #include <util/system.h> #include <util/threadnames.h> #include <util/translation.h> -#include <util/asmap.h> #include <validation.h> #include <hash.h> @@ -1840,14 +1840,14 @@ bool AppInitMain(NodeContext& node) } std::vector<bool> asmap = CAddrMan::DecodeAsmap(asmap_path); if (asmap.size() == 0) { - InitError(strprintf(_("Could not parse asmap file '%s'").translated, asmap_path)); + InitError(strprintf(_("Could not parse asmap file %s").translated, asmap_path)); return false; } const uint256 asmap_version = SerializeHash(asmap); node.connman->SetAsmap(std::move(asmap)); - LogPrintf("Using asmap version %s for IP bucketing.\n", asmap_version.ToString()); + LogPrintf("Using asmap version %s for IP bucketing\n", asmap_version.ToString()); } else { - LogPrintf("Using /16 prefix for IP bucketing.\n"); + LogPrintf("Using /16 prefix for IP bucketing\n"); } // ********************************************************* Step 13: finished |