Performance optimization for bloom filters.

This reduces a peer's ability to attack network resources by
 using a full bloom filter, but without reducing the usability
 of bloom filters.  It sets a default match everything filter
 for peers and it generalizes a prior optimization to
 cover more cases.
This commit is contained in:
Gregory Maxwell
2013-08-18 20:21:06 -07:00
parent 4bc9a19269
commit 37c6389c5a
4 changed files with 33 additions and 7 deletions

View File

@@ -267,7 +267,7 @@ public:
nMisbehavior = 0;
fRelayTxes = false;
setInventoryKnown.max_size(SendBufferSize() / 1000);
pfilter = NULL;
pfilter = new CBloomFilter();
// Be shy and don't send version until we hear
if (hSocket != INVALID_SOCKET && !fInbound)