|
|
@ -22,32 +22,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
using namespace std::literals;
|
|
|
|
using namespace std::literals;
|
|
|
|
|
|
|
|
|
|
|
|
class AddrManTest : public AddrMan
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
explicit AddrManTest(std::vector<bool> asmap = std::vector<bool>())
|
|
|
|
|
|
|
|
: AddrMan(asmap, /*deterministic=*/true, /*consistency_check_ratio=*/100)
|
|
|
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AddrInfo* Find(const CService& addr)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
LOCK(m_impl->cs);
|
|
|
|
|
|
|
|
return m_impl->Find(addr);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AddrInfo* Create(const CAddress& addr, const CNetAddr& addrSource, int* pnId)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
LOCK(m_impl->cs);
|
|
|
|
|
|
|
|
return m_impl->Create(addr, addrSource, pnId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Delete(int nId)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
LOCK(m_impl->cs);
|
|
|
|
|
|
|
|
m_impl->Delete(nId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static CNetAddr ResolveIP(const std::string& ip)
|
|
|
|
static CNetAddr ResolveIP(const std::string& ip)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CNetAddr addr;
|
|
|
|
CNetAddr addr;
|
|
|
|