extend setgenerate RPC-call with 2 pre-checks #1989

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

Diapolo commented Nov 5, 2012

  • if we are not connected and if we are downloading the block-chain don't
    start the mining threads
  • this pull makes the setgenerate-call explicit, which I found out to be a
    good thing as we don't have 4 idle threads when not needed and it
    prevents mining under erroneous conditions (which I was able to trigger
    sometimes before this patch and which lead to orphan blocks)
  • the internal miner is only used for testnet anyway these days, but I
    love it for that scenario
extend setgenerate RPC-call with 2 pre-checks
- if we are not connected and if we are downloading the block-chain don't
  start the mining threads
- this pull makes the setgenerate-call explicit, which I found out to be a
  good thing as we don't have 4 idle threads when not needed and it
  prevents mining under erroneous conditions (which I was able to trigger
  sometimes before this patch and which lead to orphan blocks)
- the internal miner is only used for testnet anyway these days, but I
  love it for that scenario
Contributor

jgarzik commented Nov 5, 2012

I understand the motivation -- I use the internal miner every day on testnet -- but this change would defeat anyone who scripts setgenerate-on-startup, because it does not automatically re-enable mining once IBD is complete.

Diapolo commented Nov 5, 2012

You are right, but to automatically enable the miner it would still be possible to use -gen or set it via the bitcoin.conf. But if you see no way that this options suffice, you are free to close the pull.

Contributor

gavinandresen commented Nov 5, 2012

I agree with jgarzik. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment