Skip to content

Commit

Permalink
Removed block-stale and new_txs_size share punishments
Browse files Browse the repository at this point in the history
  • Loading branch information
jtoomim committed Apr 15, 2017
1 parent 428bbe4 commit b57a4ff
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions p2pool/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,6 @@ def _get_other_txs(self, tracker, known_txs):
return [known_txs[tx_hash] for tx_hash in other_tx_hashes]

def should_punish_reason(self, previous_block, bits, tracker, known_txs):
if (self.header['previous_block'], self.header['bits']) != (previous_block, bits) and self.header_hash != previous_block and self.peer_addr is not None:
return True, 'Block-stale detected! height(%x) < height(%x) or %08x != %08x' % (self.header['previous_block'], previous_block, self.header['bits'].bits, bits.bits)

if self.pow_hash <= self.header['bits'].target:
return -1, 'block solution'

Expand All @@ -374,10 +371,6 @@ def should_punish_reason(self, previous_block, bits, tracker, known_txs):
all_txs_size = sum(bitcoin_data.tx_type.packed_size(tx) for tx in other_txs)
if all_txs_size > 1000000:
return True, 'txs over block size limit'

new_txs_size = sum(bitcoin_data.tx_type.packed_size(known_txs[tx_hash]) for tx_hash in self.share_info['new_transaction_hashes'])
if new_txs_size > 1000000:
return True, 'new txs over limit'

return False, None

Expand Down

0 comments on commit b57a4ff

Please sign in to comment.