aboutsummaryrefslogtreecommitdiff
path: root/src/addrdb.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-08-21 15:20:00 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-09-09 09:12:12 +0200
commitfa4e2ccfd8ae96c381947285bef47cb39474ac89 (patch)
treedf8e09e36ea5ddd58345736a6efc6692015b1e0a /src/addrdb.cpp
parentfa5aeec80c6cdca9ca027d80dff3b397911ff2c2 (diff)
Inline ReadPeerAddresses
No need to have a function that is only called in one place
Diffstat (limited to 'src/addrdb.cpp')
-rw-r--r--src/addrdb.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/addrdb.cpp b/src/addrdb.cpp
index fd85e717e3..77f0897a7f 100644
--- a/src/addrdb.cpp
+++ b/src/addrdb.cpp
@@ -177,12 +177,6 @@ bool DumpPeerAddresses(const ArgsManager& args, const CAddrMan& addr)
return SerializeFileDB("peers", pathAddr, addr, CLIENT_VERSION);
}
-bool ReadPeerAddresses(const ArgsManager& args, CAddrMan& addr)
-{
- const auto pathAddr = args.GetDataDirNet() / "peers.dat";
- return DeserializeFileDB(pathAddr, addr, CLIENT_VERSION);
-}
-
bool ReadFromStream(CAddrMan& addr, CDataStream& ssPeers)
{
return DeserializeDB(ssPeers, addr, false);
@@ -194,7 +188,8 @@ std::optional<bilingual_str> LoadAddrman(const std::vector<bool>& asmap, const A
addrman = std::make_unique<CAddrMan>(asmap, /* deterministic */ false, /* consistency_check_ratio */ check_addrman);
int64_t nStart = GetTimeMillis();
- if (ReadPeerAddresses(args, *addrman)) {
+ const auto path_addr{args.GetDataDirNet() / "peers.dat"};
+ if (DeserializeFileDB(path_addr, *addrman, CLIENT_VERSION)) {
LogPrintf("Loaded %i addresses from peers.dat %dms\n", addrman->size(), GetTimeMillis() - nStart);
} else {
// Addrman can be in an inconsistent state after failure, reset it