Bitcoin Institute

Trojan Time Machine Chain

2 messages BitcoinTalk Ground Loop, ArtForz August 3, 2010 — August 3, 2010
Ground Loop August 3, 2010 07:09 UTC Link to this message

If I remember right, the “lock in” of checkpoints is a relatively new thing in the client.

ArtForz August 3, 2010 15:12 UTC Link to this message

Looks like “best block chain” does not simply mean “longest chain of blocks” but “highest sum of difficulty”. check main.cpp CBlock::AddToBlockIndex

pindexNew->bnChainWork = (pindexNew->pprev ? pindexNew->pprev->bnChainWork : 0) + pindexNew->GetBlockWork()
...
if (pindexNew->bnChainWork > bnBestChainWork)
...

now, what does GetBlockWork() do? main.h

    CBigNum GetBlockWork() const
    {
        return (CBigNum(1)<<256) / (CBigNum().SetCompact(nBits)+1);
    }

So a single block of the real chain at 200 difficulty is “worth” 200 blocks of your 1.0 chain…