4 day min stake age

This commit is contained in:
EverGreenCoin 2017-10-27 08:00:02 -04:00
parent 95547e9791
commit 78965bc349

View File

@ -1999,6 +1999,7 @@ bool CTransaction::GetCoinAge(CTxDB& txdb, uint64& nCoinAge) const
CBlock block; CBlock block;
if (!block.ReadFromDisk(txindex.pos.nFile, txindex.pos.nBlockPos, false)) if (!block.ReadFromDisk(txindex.pos.nFile, txindex.pos.nBlockPos, false))
return false; // unable to read block of previous transaction return false; // unable to read block of previous transaction
if ( nBestHeight > (int)HF_BLOCK ) nStakeMinAge = 60 * 60 * 24 * 4; // 4 day min stake age hardfork
if (block.GetBlockTime() + nStakeMinAge > nTime) if (block.GetBlockTime() + nStakeMinAge > nTime)
continue; // only count coins meeting min age requirement continue; // only count coins meeting min age requirement
@ -3350,6 +3351,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
printf(" getblocks stopping at %d %s\n", pindex->nHeight, pindex->GetBlockHash().ToString().substr(0,20).c_str()); printf(" getblocks stopping at %d %s\n", pindex->nHeight, pindex->GetBlockHash().ToString().substr(0,20).c_str());
// ppcoin: tell downloading node about the latest block if it's // ppcoin: tell downloading node about the latest block if it's
// without risk being rejected due to stake connection check // without risk being rejected due to stake connection check
if ( nBestHeight > (int)HF_BLOCK ) nStakeMinAge = 60 * 60 * 24 * 4; // 4 day min stake age hardfork
if (hashStop != hashBestChain && pindex->GetBlockTime() + nStakeMinAge > pindexBest->GetBlockTime()) if (hashStop != hashBestChain && pindex->GetBlockTime() + nStakeMinAge > pindexBest->GetBlockTime())
pfrom->PushInventory(CInv(MSG_BLOCK, hashBestChain)); pfrom->PushInventory(CInv(MSG_BLOCK, hashBestChain));
break; break;