Browse Source

Limit CNode::mapAskFor

Tighten resource constraints on CNode.
0.10
Wladimir J. van der Laan 10 years ago
parent
commit
d4168c82be
  1. 2
      src/net.cpp
  2. 2
      src/net.h

2
src/net.cpp

@ -2106,6 +2106,8 @@ CNode::~CNode()
void CNode::AskFor(const CInv& inv) void CNode::AskFor(const CInv& inv)
{ {
if (mapAskFor.size() > MAPASKFOR_MAX_SZ)
return;
// We're using mapAskFor as a priority queue, // We're using mapAskFor as a priority queue,
// the key is the earliest time the request can be sent // the key is the earliest time the request can be sent
int64_t nRequestTime; int64_t nRequestTime;

2
src/net.h

@ -51,6 +51,8 @@ static const bool DEFAULT_UPNP = USE_UPNP;
#else #else
static const bool DEFAULT_UPNP = false; static const bool DEFAULT_UPNP = false;
#endif #endif
/** The maximum number of entries in mapAskFor */
static const size_t MAPASKFOR_MAX_SZ = MAX_INV_SZ;
unsigned int ReceiveFloodSize(); unsigned int ReceiveFloodSize();
unsigned int SendBufferSize(); unsigned int SendBufferSize();

Loading…
Cancel
Save