Skip to content

Commit

Permalink
tentative partial fix for bug p2pool#274
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestv committed Feb 23, 2016
1 parent b8ddb3f commit 6f114e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions p2pool/p2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,13 @@ def update_remote_view_of_my_known_txs(before, after):
def update_remote_view_of_my_mining_txs(before, after):
added = set(after) - set(before)
removed = set(before) - set(after)
if removed:
self.send_forget_tx(tx_hashes=list(removed))
self.remote_remembered_txs_size -= sum(100 + bitcoin_data.tx_type.packed_size(before[x]) for x in removed)
if added:
self.remote_remembered_txs_size += sum(100 + bitcoin_data.tx_type.packed_size(after[x]) for x in added)
assert self.remote_remembered_txs_size <= self.max_remembered_txs_size
fragment(self.send_remember_tx, tx_hashes=[x for x in added if x in self.remote_tx_hashes], txs=[after[x] for x in added if x not in self.remote_tx_hashes])
if removed:
self.send_forget_tx(tx_hashes=list(removed))
self.remote_remembered_txs_size -= sum(100 + bitcoin_data.tx_type.packed_size(before[x]) for x in removed)
watch_id2 = self.node.mining_txs_var.transitioned.watch(update_remote_view_of_my_mining_txs)
self.connection_lost_event.watch(lambda: self.node.mining_txs_var.transitioned.unwatch(watch_id2))

Expand Down

0 comments on commit 6f114e5

Please sign in to comment.