X-Git-Url: https://git.novaco.in/?p=NovacoinLibrary.git;a=blobdiff_plain;f=Novacoin%2FCBlockStore.cs;fp=Novacoin%2FCBlockStore.cs;h=62a021f970fa52b15b2cbef829372028de701e02;hp=1861ef28fe8772c128a1e39d5d45577930051508;hb=6b0501a53995f78928332cfcd7ce1cae4b07486f;hpb=dca0988a79212a105ae430b05bc00f64bef4b7c7 diff --git a/Novacoin/CBlockStore.cs b/Novacoin/CBlockStore.cs index 1861ef2..62a021f 100644 --- a/Novacoin/CBlockStore.cs +++ b/Novacoin/CBlockStore.cs @@ -970,20 +970,22 @@ namespace Novacoin if (tx.IsCoinStake) { - // Coin stake tx earns reward instead of paying fee - long nCoinAge; - if (!tx.GetCoinAge(ref inputs, out nCoinAge)) + if (HashCheckpoints.LastCheckpointTime < tx.nTime) { - return false; // unable to get coin age for coinstake - } - - long nReward = tx.nValueOut - nValueIn; + // Coin stake tx earns reward instead of paying fee + long nCoinAge; + if (!tx.GetCoinAge(ref inputs, out nCoinAge)) + { + return false; // unable to get coin age for coinstake + } - long nCalculatedReward = CBlock.GetProofOfStakeReward(nCoinAge, cursorBlock.nBits, tx.nTime) - tx.GetMinFee(1, false, CTransaction.MinFeeMode.GMF_BLOCK) + CTransaction.nCent; + long nReward = tx.nValueOut - nValueIn; + long nCalculatedReward = CBlock.GetProofOfStakeReward(nCoinAge, cursorBlock.nBits, tx.nTime) - tx.GetMinFee(1, false, CTransaction.MinFeeMode.GMF_BLOCK) + CTransaction.nCent; - if (nReward > nCalculatedReward) - { - return false; // coinstake pays too much + if (nReward > nCalculatedReward) + { + return false; // coinstake pays too much + } } } else