Skip to content

testnet getwork/getmemorypool bug #848

@gavinandresen

Description

@gavinandresen

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions