Skip to content

Commit

Permalink
limit remote_tx_hashes set to 10000 items
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestv committed Nov 5, 2012
1 parent d1c47c2 commit 62c10bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions p2pool/p2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,15 @@ def handle_bestblock(self, header):
('tx_hashes', pack.ListType(pack.IntType(256))),
])
def handle_have_tx(self, tx_hashes):
assert self.remote_tx_hashes.isdisjoint(tx_hashes)
#assert self.remote_tx_hashes.isdisjoint(tx_hashes)
self.remote_tx_hashes.update(tx_hashes)
while len(self.remote_tx_hashes) > 10000:
self.remote_tx_hashes.pop()
message_losing_tx = pack.ComposedType([
('tx_hashes', pack.ListType(pack.IntType(256))),
])
def handle_losing_tx(self, tx_hashes):
assert self.remote_tx_hashes.issuperset(tx_hashes)
#assert self.remote_tx_hashes.issuperset(tx_hashes)
self.remote_tx_hashes.difference_update(tx_hashes)


Expand Down

0 comments on commit 62c10bd

Please sign in to comment.