Skip to content

Commit

Permalink
Fix incorrect indentation causing shares to be reported as rejected t…
Browse files Browse the repository at this point in the history
…o the miner despite being accepted
  • Loading branch information
metalicjames committed Dec 3, 2017
1 parent e51ba5a commit 3d0f826
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions p2pool/bitcoin/stratum.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ def rpc_submit(self, worker_name, job_id, extranonce2, ntime, nonce):
res = got_response(header, worker_name, coinb_nonce)
if len(self.wb._inner.my_share_hashes) > 20:
if float(len(self.wb._inner.my_doa_share_hashes)) / float(len(self.wb._inner.my_share_hashes)) > 0.60:
self.transport.loseConnection()
return res
self.transport.loseConnection()

# Disconnect miners with large hash > target to prevent DoS
if self.wb._inner.total_hashes > 20:
if float(self.wb._inner.invalid_hashes) / float(self.wb._inner.total_hashes) > 0.05:
self.transport.loseConnection()
return res

return res

def close(self):
self.wb.new_work_event.unwatch(self.watch_id)
Expand Down

0 comments on commit 3d0f826

Please sign in to comment.