aboutsummaryrefslogtreecommitdiff
path: root/src/addrdb.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-08-21 13:49:16 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-09-09 09:11:41 +0200
commitfa5aeec80c6cdca9ca027d80dff3b397911ff2c2 (patch)
treeebf8556dc2ff667bf3929c1f2bc3a72b447fe77a /src/addrdb.h
parente4aa9b15b9f80a08076ad329b473fe9107d9e65e (diff)
downloadbitcoin-fa5aeec80c6cdca9ca027d80dff3b397911ff2c2.tar.xz
Move LoadAddrman from init to addrdb
Init should only concern itself with the initialization order, not the detailed initialization logic of every module. Also, inlining logic into a method that is ~800 lines of code, makes it impossible to unit test on its own.
Diffstat (limited to 'src/addrdb.h')
-rw-r--r--src/addrdb.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/addrdb.h b/src/addrdb.h
index c31c126ee3..99d8a975f4 100644
--- a/src/addrdb.h
+++ b/src/addrdb.h
@@ -10,12 +10,14 @@
#include <net_types.h> // For banmap_t
#include <univalue.h>
+#include <optional>
#include <vector>
class ArgsManager;
class CAddrMan;
class CAddress;
class CDataStream;
+struct bilingual_str;
bool DumpPeerAddresses(const ArgsManager& args, const CAddrMan& addr);
bool ReadPeerAddresses(const ArgsManager& args, CAddrMan& addr);
@@ -46,6 +48,9 @@ public:
bool Read(banmap_t& banSet);
};
+/** Returns an error string on failure */
+std::optional<bilingual_str> LoadAddrman(const std::vector<bool>& asmap, const ArgsManager& args, std::unique_ptr<CAddrMan>& addrman);
+
/**
* Dump the anchor IP address database (anchors.dat)
*