Post
Topic
Board Development & Technical Discussion
Re: Regtest Consensus Forking Behavior Introduced in Bitcoin Core in May 2014
by
TierNolan
on 20/05/2015, 16:28:47 UTC
I agree this is not a bad idea, however it does mean that whatever is creating the block also has to be modified since they are most likely mining blocks using either the bult-in CPU miner, or based on details from getblocktemplate (which include the target bits).  They would therefore, by default, be aiming to create blocks using the higher difficulty.

The CPU miner in core mines in 2 steps.  It scans until it finds a block with the top 8 bits equal to zero (ScanHash) and then does a more complex check.

It doesn't use CheckProofOfWork directly though.  If it did, then the internal miner could be used, since the mask would be taken into account.  This should probably be changed.

If the target gives less than 256 hashes per block, then the first check will ignore some block headers that meet the full POW.  Block hashes with fewer than 8 leading zero bits would be rejected by the pre-filter.

I think external test programs should be able to handle the non-standard behaviour?