From ed9ba8af08f857bda3ce2f77413317374c22d7b4 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Thu, 5 Aug 2021 13:51:52 +0100 Subject: [tests] Remove CAddrMan.Clear() call from CAddrDB::Read() `bool CAddrDB::Read(CAddrMan& addr, CDataStream& ssPeers)` is _only_ called from the tests, and the call to addr.Clear() only exists so that a test that Clear() is called passes. Remove that test and the call. --- src/addrdb.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/addrdb.cpp') diff --git a/src/addrdb.cpp b/src/addrdb.cpp index c3e224ee83..a5383be7cf 100644 --- a/src/addrdb.cpp +++ b/src/addrdb.cpp @@ -244,12 +244,7 @@ bool CAddrDB::Read(CAddrMan& addr) bool CAddrDB::Read(CAddrMan& addr, CDataStream& ssPeers) { - bool ret = DeserializeDB(ssPeers, addr, false); - if (!ret) { - // Ensure addrman is left in a clean state - addr.Clear(); - } - return ret; + return DeserializeDB(ssPeers, addr, false); } void DumpAnchors(const fs::path& anchors_db_path, const std::vector& anchors) -- cgit v1.2.3