Post
Topic
Board Development & Technical Discussion
Re: Python based Solo miner for CPU | Learn Basic Bitcoin Mining | Just for fun
by
vshoes
on 07/03/2024, 12:32:46 UTC
One more q for anyone who might be able to answer;

Code:
        if hash < target :
    #    if(hash[:10] == '0000000000'):
            print('success!!')
            print('hash: {}'.format(hash))
            payload = bytes('{"params": ["'+address+'", "'+job_id+'", "'+extranonce2 \
                +'", "'+ntime+'", "'+nonce+'"], "id": 1, "method": "mining.submit"}\n', 'utf-8')
            sock.sendall(payload)
            print(sock.recv(1024))
            input("Press Enter to continue...")

Why are we evaluating hash < target? Shouldn't that be

Code:
if hash == target:
     print('success!!')