diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-08-21 11:22:21 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-09-07 11:05:16 +0200 |
commit | fade9a1a4db71241ccad03fdacfb626453952963 (patch) | |
tree | 08c9e5b360cd324eac820a7600cfc39707be9ec2 /src/addrdb.h | |
parent | fa7f77b7d1709bf35808fced0d67b6e97b784d63 (diff) |
Remove confusing CAddrDB
The class only stores the file path, reading it from a global. Globals
are confusing and make testing harder.
The method reading from a stream does not even use any class members, so
putting it in a class is also confusing.
Diffstat (limited to 'src/addrdb.h')
-rw-r--r-- | src/addrdb.h | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/addrdb.h b/src/addrdb.h index 26b1c5880f..c31c126ee3 100644 --- a/src/addrdb.h +++ b/src/addrdb.h @@ -12,21 +12,15 @@ #include <vector> -class CAddress; +class ArgsManager; class CAddrMan; +class CAddress; class CDataStream; -/** Access to the (IP) address database (peers.dat) */ -class CAddrDB -{ -private: - fs::path pathAddr; -public: - CAddrDB(); - bool Write(const CAddrMan& addr); - bool Read(CAddrMan& addr); - static bool Read(CAddrMan& addr, CDataStream& ssPeers); -}; +bool DumpPeerAddresses(const ArgsManager& args, const CAddrMan& addr); +bool ReadPeerAddresses(const ArgsManager& args, CAddrMan& addr); +/** Only used by tests. */ +bool ReadFromStream(CAddrMan& addr, CDataStream& ssPeers); /** Access to the banlist database (banlist.json) */ class CBanDB |