mirror of
https://github.com/cygnusxi/CurecoinSource.git
synced 2025-07-27 23:54:22 +02:00
Define hardfork block height. Eliminate PoW blocks beyond this height.
This commit is contained in:
parent
ecabec1e6a
commit
3d03cecd38
@ -2209,6 +2209,9 @@ bool CBlock::CheckBlock(bool fCheckPOW, bool fCheckMerkleRoot) const
|
||||
|
||||
bool CBlock::AcceptBlock()
|
||||
{
|
||||
// STS check version
|
||||
if (nVersion > CURRENT_VERSION)
|
||||
return DoS(100, error("AcceptBlock() : reject unknown block version %d", nVersion));
|
||||
// Check for duplicate
|
||||
uint256 hash = GetHash();
|
||||
if (mapBlockIndex.count(hash))
|
||||
@ -2221,6 +2224,9 @@ bool CBlock::AcceptBlock()
|
||||
CBlockIndex* pindexPrev = (*mi).second;
|
||||
int nHeight = pindexPrev->nHeight+1;
|
||||
|
||||
if (IsProofOfWork() && nHeight > HF_BLOCK)
|
||||
return DoS(100, error("AcceptBloock() : rejected pow block at height %d", nHeight));
|
||||
|
||||
// Check proof-of-work or proof-of-stake
|
||||
if (nBits != GetNextTargetRequired(pindexPrev, IsProofOfStake()))
|
||||
return DoS(100, error("AcceptBlock() : incorrect %s", IsProofOfWork() ? "proof-of-work" : "proof-of-stake"));
|
||||
|
@ -36,6 +36,7 @@ static const int64 MAX_MINT_PROOF_OF_WORK = 13 * COIN; //Lucky number 13 Coins p
|
||||
static const int64 MAX_MINT_PROOF_OF_STAKE = 0.01 * MAX_MINT_PROOF_OF_WORK; //1% annual interest reward the folders and holders
|
||||
static const int64 MIN_TXOUT_AMOUNT = MIN_TX_FEE;
|
||||
static const unsigned int MAX_TX_COMMENT_LEN = 268; // curecoin: 256 bytes + 12 little extra
|
||||
static const unsigned int HF_BLOCK = 200000; // hardfork's block height
|
||||
|
||||
inline bool MoneyRange(int64 nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
|
||||
// Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp.
|
||||
|
Loading…
x
Reference in New Issue
Block a user