From fa5aeec80c6cdca9ca027d80dff3b397911ff2c2 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sat, 21 Aug 2021 13:49:16 +0200 Subject: 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. --- src/addrdb.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/addrdb.h') 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 // For banmap_t #include +#include #include 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 LoadAddrman(const std::vector& asmap, const ArgsManager& args, std::unique_ptr& addrman); + /** * Dump the anchor IP address database (anchors.dat) * -- cgit v1.2.3