This is a patch against SVN 159 that allows external RPC clients to ask for unsolved block data and eventually submit back a solution.
It opens the way for external bitcoin miners. If non-local RPC is used it also enables multiple-miners-to-client arrangement.
EDIT:
theymos is expressing some concerns regarding extraNonce
hereThere are actually many components of a block that change its hash. Let's assume the block contains only the initial (award) transaction. The hash will change if either:
- transactions merkle hash - if you change txOUT publicKey, txIN difficulty or extraNonce
- block time - 4 bytes that are updated every n seconds in the original client
- block's nonce
Bitcoin is giving by default each mining thread it's unique extraNonce (to ensure different hash space). However if there are new transactions after at least 60 seconds merkle hash will change. This patch rebuilds merkle hash at each request for work because of the new extraNonce it assigns. If there are new transactions it should rebuild merkle hash anyway so I don't think this is much of a problem. Also, the external miner may change it's block time if needed - it will get back and processed/verified accordingly.
I made some tests with difficulty of 1 and generation rate was equal to the expected values.