Then check the latest work data against a store of the current_block and use it to determine if we have moved to a new block.
This makes --no-longpoll work just as efficiently as longpoll, and works around when longpoll is unreliable.
Efficiency is the percentage of getworks compared to the amount of
work requested from the pool. It can go higher than 100% in case
more shares than getworks were found. Some pools prefer miners to
have a high efficiency; CPU miners likely exhibit a low efficiency.
Utility is the number of shares found per minute, since the miner
was started. It is another way to describe the effectiveness of
a miner.
If there are no GPUs, set nDevs to 0 not -1 (status is set to an
unhelpful -1001 here on my laptop, so we can't rely on a particular
status value).
Also, if nDevs is -1, exit rather than screwing up later.
Currently it gets negated which means the default printed is wrong.
Use an explicit flag to tell if the user has overridden it; if they
haven't, and they turn off the GPUs, reset it to num_processors.
This cleans up option handling, by using ccan/opt rather than
handcoded getopt_long. We still have to open-code some things, such
as json config file handling.
The main change is that the --config option causes a file to be parsed
during commandline parsing, so you can override the results, and
provide multiple of them.
Other improvements are that 'help' and 'ndevs' are not valid arguments
in the config file; we use a separate argument table for such
commandline-only flags.
Disable signal handling and use many curl handles instead, thus making work more asynchronous.
Theoretically a curl can wait forever on a dns lookup with this but it's extremely unlikely.