Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Commit

Permalink
--scrypt parameter renamed to --scrypt-target / -st
Browse files Browse the repository at this point in the history
  • Loading branch information
admin-slush committed Jan 21, 2014
1 parent c31bb98 commit 9888960
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions mining_libs/jobs.py
Expand Up @@ -80,10 +80,10 @@ def serialize_header(self, merkle_root, ntime, nonce):
return r

class JobRegistry(object):
def __init__(self, f, cmd, scrypt, no_midstate, real_target, use_old_target=False):
def __init__(self, f, cmd, no_midstate, real_target, use_old_target=False, scrypt_target=False):
self.f = f
self.cmd = cmd # execute this command on new block
self.scrypt = scrypt # calculate target for scrypt algorithm instead of sha256
self.scrypt_target = scrypt_target # calculate target for scrypt algorithm instead of sha256
self.no_midstate = no_midstate # Indicates if calculate midstate for getwork
self.real_target = real_target # Indicates if real stratum target will be propagated to miners
self.use_old_target = use_old_target # Use 00000000fffffff...f instead of correct 00000000ffffffff...0 target for really old miners
Expand Down Expand Up @@ -113,7 +113,7 @@ def set_extranonce(self, extranonce1, extranonce2_size):
self.extranonce1_bin = binascii.unhexlify(extranonce1)

def set_difficulty(self, new_difficulty):
if self.scrypt:
if self.scrypt_target:
dif1 = 0x0000ffff00000000000000000000000000000000000000000000000000000000
else:
dif1 = 0x00000000ffff0000000000000000000000000000000000000000000000000000
Expand Down
4 changes: 2 additions & 2 deletions mining_proxy.py
Expand Up @@ -44,7 +44,7 @@ def parse_args():
parser.add_argument('-v', '--verbose', dest='verbose', action='store_true', help='Enable low-level debugging messages')
parser.add_argument('-q', '--quiet', dest='quiet', action='store_true', help='Make output more quiet')
parser.add_argument('-i', '--pid-file', dest='pid_file', type=str, help='Store process pid to the file')
parser.add_argument('-s', '--scrypt', dest='scrypt', action='store_true', help='Calculate targets for scrypt algorithm')
parser.add_argument('-st', '--scrypt-target', dest='scrypt_target', action='store_true', help='Calculate targets for scrypt algorithm')
return parser.parse_args()

from stratum import settings
Expand Down Expand Up @@ -213,7 +213,7 @@ def main(args):
event_handler=client_service.ClientMiningService)


job_registry = jobs.JobRegistry(f, cmd=args.blocknotify_cmd, scrypt=args.scrypt,
job_registry = jobs.JobRegistry(f, cmd=args.blocknotify_cmd, scrypt_target=args.scrypt_target,
no_midstate=args.no_midstate, real_target=args.real_target, use_old_target=args.old_target)
client_service.ClientMiningService.job_registry = job_registry
client_service.ClientMiningService.reset_timeout()
Expand Down

0 comments on commit 9888960

Please sign in to comment.