Skip to content
This repository was archived by the owner on Jul 18, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lib/template_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,7 @@ def _update_block(self, data):
def diff_to_target(self, difficulty):
'''Converts difficulty to target'''
'''diff1 = 0x00000000ffff0000000000000000000000000000000000000000000000000000'''
'''I need help here - is this correct? - please see reference'''
''' https://bitcointalk.org/index.php?topic=27970.0 '''
#diff1 = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0f0000
diff1 = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000
diff1 = 0x0000ffff00000000000000000000000000000000000000000000000000000000
return diff1 / difficulty

def get_job(self, job_id):
Expand Down
10 changes: 7 additions & 3 deletions mining/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@ def _finish_after_subscribe(self, result):
return result

# Force set higher difficulty
# change this (default "16") to alter your share difficulty.
# Setting to "1" will produce difficulty 1 shares, default is difficulty "16".
self.connection_ref().rpc('mining.set_difficulty', [16,], is_notification=True)
# Change this (default "16") to alter your share difficulty.
# Setting to "1" will produce difficulty 1 shares.
diff = 16
self.connection_ref().rpc('mining.set_difficulty', [diff,], is_notification=True)
session = self.connection_ref().get_session()
session['difficulty'] = diff

#self.connection_ref().rpc('client.get_version', [])

# Force client to remove previous jobs if any (eg. from previous connection)
Expand Down