pooler / cpuminer

CPU miner for Litecoin and Bitcoin
https://bitcointalk.org/index.php?topic=55038.0
Other
2.77k stars 1.21k forks source link

Disabling proof-of-work #42

Closed hrj closed 10 years ago

hrj commented 10 years ago

How do I configure this miner so that it doesn't send proof-of-work to the server? I am solo mining (against conventional wisdom) and hence would like to avoid the proof-of-work overhead.

If I understand right, every time a proof-of-work is sent, a new work is provided by the server and the search for a hash begins anew. I would like to avoid that.

I tried to understand the code, but couldn't fully grok it (perhaps because I haven't fully understood the protocols). If there is some tweak I can do to the code, in the absence of a configuration, please do let me know.

pooler commented 10 years ago

No useless proof-of-work messages are sent. When you mine in a pool, you solve shares, and you need to submit them to the server. When you mine solo, you solve blocks, and you need to submit them to the server. There is no difference between the two at the protocol level (the only difference is the target), and the miner doesn't even try to differentiate between the two cases, because there is no need to. So, if you are mining solo, a proof-of-work solution is only sent back to the server when you find a block (i.e. when the target is met); which means very, very rarely. The miner still needs to fetch fresh work frequently, so that new transactions can be inserted in the block candidate. But that's another story.

hrj commented 10 years ago

Thanks for your detailed response.

I am seeing new work messages from minerd every 5 seconds or so. Is that normal? Is that the right frequency at which new transactions need to be inserted into a block candidate?

pooler commented 10 years ago

That is normal. 5 seconds is the default scan time, which you can alter by using the -s option. Since there is no long polling facility, it is a good idea to refresh work frequently, to minimize the probability of working on an old block.