Fix de-serialization bug where AddrMan is corrupted after exception

* CAddrDB modified so that when de-serialization code throws an exception Addrman is reset to a clean state
* CAddrDB modified to make unit tests possible
* Regression test created to ensure bug is fixed
* StartNode modifed to clear adrman if CAddrDB::Read returns an error code.
This commit is contained in:
EthanHeilman
2016-03-16 12:54:30 -04:00
committed by Ethan Heilman
parent 326f010332
commit 1475ecf611
4 changed files with 146 additions and 0 deletions

View File

@@ -779,6 +779,7 @@ public:
CAddrDB();
bool Write(const CAddrMan& addr);
bool Read(CAddrMan& addr);
bool Read(CAddrMan& addr, CDataStream& ssPeers);
};
/** Access to the banlist database (banlist.dat) */