Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: jgarzik on November 21, 2010, 09:21:12 AM



Title: [PATCH] modularize BitcoinMiner a bit (code movement)
Post by: jgarzik on November 21, 2010, 09:21:12 AM
URL: http://yyz.us/bitcoin/patch.bitcoin-modularize_miner

This patch is similar to patches sometimes seen in the Linux kernel.  Analogous to an algebraic reduction, or a step in a mathematic proof, this patch intentionally makes zero functional code changes.  It moves two chunks of code -- hash meter and check-solution -- from the BitcoinMiner() function into separate functions.

This change makes it easier to integrate remote mining.


Title: Re: [PATCH] modularize BitcoinMiner a bit (code movement)
Post by: Cdecker on November 21, 2010, 04:36:07 PM
Seems to be ok: +1


Title: Re: [PATCH] modularize BitcoinMiner a bit (code movement)
Post by: jgarzik on November 21, 2010, 09:43:21 PM
Patch updated to move prepare-work and prepare-hash-buffer code into separate functions.

Again, no code changes, just code movement.

The patch now looks similar to m0mchil's getwork patch, and makes integrating remote mining much easier.


Title: Re: [PATCH] modularize BitcoinMiner a bit (code movement)
Post by: jgarzik on November 22, 2010, 09:13:53 AM
Patch updated to fix silly parameter passing bug in one of the new functions.  Code now generates correct blocks on testnet, as expected.


Title: Re: [PATCH] modularize BitcoinMiner a bit (code movement)
Post by: jgarzik on November 23, 2010, 12:04:40 AM
Updated to SVN r188 (accounts).


Title: Re: [PATCH] modularize BitcoinMiner a bit (code movement)
Post by: jgarzik on November 23, 2010, 10:46:32 PM
This patch is entirely superceded by SVN r189, satoshi's version of getwork.