CBlockIndex::GetBlockTrust method

From Peercoin Wiki
Jump to: navigation, search

Source

https://github.com/ppcoin/ppcoin/blob/v0.4.0ppc/src/main.h#L1269

CBigNum CBlockIndex::GetBlockTrust() const
{
    CBigNum bnTarget;
    bnTarget.SetCompact(nBits);
    if (bnTarget <= 0)
        return 0;
    return (IsProofOfStake()? (CBigNum(1)<<256) / (bnTarget+1) : 1);
}

Description

Excerpts from the Peercoin white paper

« The hash target that stake kernel must meet is a target per unit coin age (coin-day) consumed in the kernel (in contrast to Bitcoin's proof-of-work target which is a fixed target value applying to every node). Thus the more coin age consumed in the kernel, the easier meeting the hash target protocol. »

« The protocol for determining which competing block chain wins as main chain has been switched over to use consumed coin age. Here every transaction in a block contributes its consumed coin age to the score of the block. The block chain with highest total consumed coin age is chosen as main chain. »

FAQ

<TODO>
<TODO>


Feel free to add your own questions in this FAQ

Links