X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fmain.h;h=4064a1d049318c25afaab18817190432ae147c4c;hp=e4c596f56a190c30c09ce6af28a81416930c08a5;hb=10db7eddb688a980032d781b190b94955eb1314c;hpb=c34c8413800562d59454691813836276f84b4e74 diff --git a/src/main.h b/src/main.h index e4c596f..4064a1d 100644 --- a/src/main.h +++ b/src/main.h @@ -117,7 +117,7 @@ bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey); bool CheckProofOfWork(uint256 hash, unsigned int nBits); int64 GetProofOfWorkReward(unsigned int nBits); int64 GetProofOfStakeReward(int64 nCoinAge); -unsigned int ComputeMinWork(unsigned int nBase, int64 nTime); +unsigned int ComputeMinWork(unsigned int nBase, int64 nTime, bool fProofOfStake, int nHeight); int GetNumBlocksOfPeers(); bool IsInitialBlockDownload(); std::string GetWarnings(std::string strFor); @@ -957,6 +957,7 @@ public: return thash; } + int GetBlockHeight() const; int64 GetBlockTime() const { @@ -1365,18 +1366,6 @@ public: return (nFlags & BLOCK_PROOF_OF_STAKE); } - static bool IsSuperMajority(int minVersion, const CBlockIndex* pstart, unsigned int nRequired, unsigned int nToCheck) - { - unsigned int nFound = 0; - for (unsigned int i = 0; i < nToCheck && nFound < nRequired && pstart != NULL; i++) - { - if (pstart->nVersion >= minVersion) - ++nFound; - pstart = pstart->pprev; - } - return (nFound >= nRequired); - } - void SetProofOfStake() { nFlags |= BLOCK_PROOF_OF_STAKE; @@ -1434,13 +1423,11 @@ class CDiskBlockIndex : public CBlockIndex public: uint256 hashPrev; uint256 hashNext; - int nProtocolVersion; CDiskBlockIndex() { hashPrev = 0; hashNext = 0; - nProtocolVersion = PROTOCOL_VERSION; } explicit CDiskBlockIndex(CBlockIndex* pindex) : CBlockIndex(*pindex) @@ -1462,7 +1449,6 @@ public: READWRITE(nMoneySupply); READWRITE(nFlags); READWRITE(nStakeModifier); - READWRITE(nProtocolVersion); if (IsProofOfStake()) { READWRITE(prevoutStake);