bitcoin/bitcoin — Issue #848: testnet getwork/getmemorypool bug
Author: gavinandresen
Created: 2012-02-16 14:41:23+00:00
State: open

The changes I made to ensure that at least one block every 20 minutes (or so) is created on testnet makes external miners create lots of invalid blocks.

The testnet-only change was to drop the difficulty to minimum if it has been 20 minutes or more since generating the last block (as measured by block timestamps). I missed two places in bitcoinrpc.cpp where the block's nTime is updated.

The fix is easy; after updating pblock->nTime, do:

if (fTestNet)
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock);