mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 05:57:59 +01:00
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.
This commit is contained in:
@@ -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)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user