Limit number of known addresses per peer
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: 5823449
This commit is contained in:
parent
3a4a66f47e
commit
d6377e6a4a
@ -32,6 +32,7 @@ public:
|
|||||||
bool empty() const { return set.empty(); }
|
bool empty() const { return set.empty(); }
|
||||||
iterator find(const key_type& k) const { return set.find(k); }
|
iterator find(const key_type& k) const { return set.find(k); }
|
||||||
size_type count(const key_type& k) const { return set.count(k); }
|
size_type count(const key_type& k) const { return set.count(k); }
|
||||||
|
void clear() { set.clear(); queue.clear(); }
|
||||||
bool inline friend operator==(const mruset<T>& a, const mruset<T>& b) { return a.set == b.set; }
|
bool inline friend operator==(const mruset<T>& a, const mruset<T>& b) { return a.set == b.set; }
|
||||||
bool inline friend operator==(const mruset<T>& a, const std::set<T>& b) { return a.set == b; }
|
bool inline friend operator==(const mruset<T>& a, const std::set<T>& b) { return a.set == b; }
|
||||||
bool inline friend operator<(const mruset<T>& a, const mruset<T>& b) { return a.set < b.set; }
|
bool inline friend operator<(const mruset<T>& a, const mruset<T>& b) { return a.set < b.set; }
|
||||||
|
@ -255,7 +255,7 @@ public:
|
|||||||
|
|
||||||
// flood relay
|
// flood relay
|
||||||
std::vector<CAddress> vAddrToSend;
|
std::vector<CAddress> vAddrToSend;
|
||||||
std::set<CAddress> setAddrKnown;
|
mruset<CAddress> setAddrKnown;
|
||||||
bool fGetAddr;
|
bool fGetAddr;
|
||||||
std::set<uint256> setKnown;
|
std::set<uint256> setKnown;
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ public:
|
|||||||
int64_t nPingUsecTime;
|
int64_t nPingUsecTime;
|
||||||
bool fPingQueued;
|
bool fPingQueued;
|
||||||
|
|
||||||
CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn = "", bool fInboundIn=false) : ssSend(SER_NETWORK, INIT_PROTO_VERSION)
|
CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn = "", bool fInboundIn=false) : ssSend(SER_NETWORK, INIT_PROTO_VERSION), setAddrKnown(5000)
|
||||||
{
|
{
|
||||||
nServices = 0;
|
nServices = 0;
|
||||||
hSocket = hSocketIn;
|
hSocket = hSocketIn;
|
||||||
|
Loading…
Reference in New Issue
Block a user