CAddrDB: Replace BDB-managed addr.dat with internally managed peers.dat

This commit is contained in:
Jeff Garzik
2012-05-16 22:11:19 -04:00
committed by Jeff Garzik
parent 768e5d52fb
commit 928d3a011c
5 changed files with 101 additions and 67 deletions

View File

@@ -296,20 +296,15 @@ public:
/** Access to the (IP) address database (addr.dat) */
class CAddrDB : public CDB
/** Access to the (IP) address database (peers.dat) */
class CAddrDB
{
public:
CAddrDB(const char* pszMode="r+") : CDB("addr.dat", pszMode) { }
private:
CAddrDB(const CAddrDB&);
void operator=(const CAddrDB&);
boost::filesystem::path pathAddr;
public:
bool WriteAddrman(const CAddrMan& addr);
bool LoadAddresses();
CAddrDB();
bool Write(const CAddrMan& addr);
bool Read(CAddrMan& addr);
};
bool LoadAddresses();
#endif // BITCOIN_DB_H