aboutsummaryrefslogtreecommitdiff
path: root/src/addrdb.cpp
diff options
context:
space:
mode:
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