}
itemTemplate.SetStakeModifier(nStakeModifier, fGeneratedStakeModifier);
- itemTemplate.nStakeModifierChecksum = StakeModifier.GetStakeModifierChecksum(ref itemTemplate);
- // TODO: verify stake modifier checkpoints
+ var nChecksum = StakeModifier.GetModifierChecksum(ref itemTemplate);
+ if (!ModifierCheckpoints.Verify(itemTemplate.nHeight, nChecksum))
+ {
+ return false; // Stake modifier checkpoints mismatch
+ }
// Add to index
if (block.IsProofOfStake)
return false; // Invalid block found.
}
- bool fScriptChecks = cursor.nHeight >= Checkpoints.TotalBlocksEstimate;
+ bool fScriptChecks = cursor.nHeight >= HashCheckpoints.TotalBlocksEstimate;
var scriptFlags = scriptflag.SCRIPT_VERIFY_NOCACHE | scriptflag.SCRIPT_VERIFY_P2SH;
long nFees = 0;
if (tx.IsCoinStake)
{
- // ppcoin: coin stake tx earns reward instead of paying fee
+ // Coin stake tx earns reward instead of paying fee
long nCoinAge;
if (!tx.GetCoinAge(ref inputs, out nCoinAge))
{
}
// Check that the block chain matches the known block chain up to a checkpoint
- if (!Checkpoints.Verify(nHeight, nHash))
+ if (!HashCheckpoints.Verify(nHeight, nHash))
{
return false; // rejected by checkpoint lock-in
}
}
/// <summary>
- /// GEt block by hash.
+ /// Get block by hash.
/// </summary>
/// <param name="blockHash">Block hash</param>
/// <param name="block">Block object reference</param>