addrman: Introduce a test-only function to lookup addresses

Co-Authored-By: Martin Zumsande <mzumsande@gmail.com>
This commit is contained in:
Amiti Uttarwar
2021-12-09 18:25:22 +00:00
committed by Martin Zumsande
parent 7551ae81e1
commit dad5f76021
3 changed files with 76 additions and 0 deletions

View File

@@ -137,6 +137,9 @@ public:
void SetServices(const CService& addr, ServiceFlags nServices)
EXCLUSIVE_LOCKS_REQUIRED(!cs);
std::optional<AddressPosition> FindAddressEntry(const CAddress& addr)
EXCLUSIVE_LOCKS_REQUIRED(!cs);
const std::vector<bool>& GetAsmap() const;
friend class AddrManTest;
@@ -266,6 +269,8 @@ private:
std::pair<CAddress, int64_t> SelectTriedCollision_() EXCLUSIVE_LOCKS_REQUIRED(cs);
std::optional<AddressPosition> FindAddressEntry_(const CAddress& addr) EXCLUSIVE_LOCKS_REQUIRED(cs);
//! Consistency check, taking into account m_consistency_check_ratio.
//! Will std::abort if an inconsistency is detected.
void Check() const EXCLUSIVE_LOCKS_REQUIRED(cs);