nvmd / bitcoin

Bitcoin Core integration/staging tree
https://bitcoin.org/en/download
MIT License
0 stars 0 forks source link

Checkpoints::GetTotalBlocksEstimate will probably fail/produce wrong results #2

Open nvmd opened 9 years ago

nvmd commented 9 years ago

Checkpoints::GetTotalBlocksEstimate will probably fail/produce wrong results on 0.10 branch (commit 047a89831760ff124740fe9f58411d57ee087078).

checkpoints.cpp:72-80

    int GetTotalBlocksEstimate()
    {
        if (!fEnabled)
            return 0;

        const MapCheckpoints& checkpoints = *Params().Checkpoints().mapCheckpoints;

        return checkpoints.rbegin()->first;
    }

Suggest to change checkpoints.cpp:79 from return checkpoints.rbegin()->first; to return checkpoints.rbegin()->first + 1;