git://git.novaco.in
/
p2pool.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
5d5f6f9
)
fixed possible DoS - there was no limit on the number of addr entries
author
Forrest Voight
<forrest@forre.st>
Tue, 8 Jan 2013 06:04:32 +0000 (
01:04
-0500)
committer
Forrest Voight
<forrest@forre.st>
Tue, 8 Jan 2013 06:04:32 +0000 (
01:04
-0500)
p2pool/p2p.py
patch
|
blob
|
history
diff --git
a/p2pool/p2p.py
b/p2pool/p2p.py
index
99a9e87
..
343d49f
100644
(file)
--- a/
p2pool/p2p.py
+++ b/
p2pool/p2p.py
@@
-634,7
+634,8
@@
class Node(object):
old_services, old_first_seen, old_last_seen = self.addr_store[host, port]
self.addr_store[host, port] = services, old_first_seen, max(old_last_seen, timestamp)
else:
- self.addr_store[host, port] = services, timestamp, timestamp
+ if len(self.addr_store) < 10000:
+ self.addr_store[host, port] = services, timestamp, timestamp
def handle_shares(self, shares, peer):
print 'handle_shares', (shares, peer)