Permalink
Browse files

Limit number of known addresses per peer

  • Loading branch information...
Tranz5 committed Jul 22, 2014
1 parent 4ce4e03 commit 0435cfb39c46a4143f4568df37eaf2b48bbc0de9
Showing with 3 additions and 2 deletions.
  1. +1 −0 src/mruset.h
  2. +2 −2 src/net.h
@@ -30,6 +30,7 @@ template <typename T> class mruset
bool empty() const { return set.empty(); }
iterator find(const key_type& k) const { return set.find(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 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; }
@@ -249,7 +249,7 @@ class CNode
// flood relay
std::vector<CAddress> vAddrToSend;
std::set<CAddress> setAddrKnown;
mruset<CAddress> setAddrKnown;
bool fGetAddr;
std::set<uint256> setKnown;
uint256 hashCheckpointKnown; // ppcoin: known sent sync-checkpoint
@@ -260,7 +260,7 @@ class CNode
CCriticalSection cs_inventory;
std::multimap<int64, CInv> mapAskFor;
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;
hSocket = hSocketIn;

0 comments on commit 0435cfb

Please sign in to comment.