You can find it here. I want to know if it checks if it has gotten another mining job while mining.


The stratum miner processes any jobs sent to it. Although the stratum miner is one file, it is actually two processes:

  1. The main process handles the socket messages between itself and the connected pool.
  2. A worker process which mines jobs.

Line 88 (which is in the 1st process) has q.put(job), which puts a received job in a queue and line 111 (which is the 2nd process), has job = q.get(), which consumes a job and mines it.

| improve this answer | |
  • Nice. Can you have it sys.stdout.write to the terminal when it gets a new job? Im too much of a noob to do that. – Crypthusiast Apr 2 '19 at 13:38
  • By the way, thanks for all the help you have been giving me :D – Crypthusiast Apr 2 '19 at 13:38
  • 1
    It already outputs to stdout when a new job is pulled from the queue. Line 123. – jtgrassie Apr 2 '19 at 17:38
  • Thznks! jjjjjjj – Crypthusiast Apr 2 '19 at 22:10
  • 1
    You could monitor changes of height (line 118), but a stratum miner doesn't need to know when new blocks are mined to the main chain. Their job is simply to mine the block given by the pool and submit the result back. – jtgrassie Apr 2 '19 at 23:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.