X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fmain.h;h=9680bee94a335769b298dcf09183ebdae2c5a96a;hb=9ca8b78544b413ed875ff9bb6ef376e21922e6ac;hp=0ed177738241911fda3ed226517c5632e38023a9;hpb=0c0eb55c15b7cc09e8f422f1e2e54fe569f06c2e;p=novacoin.git diff --git a/src/main.h b/src/main.h index 0ed1777..9680bee 100644 --- a/src/main.h +++ b/src/main.h @@ -9,7 +9,8 @@ #include "sync.h" #include "net.h" #include "script.h" -#include "scrypt_mine.h" +#include "scrypt.h" +#include "zerocoin/Zerocoin.h" #include @@ -57,12 +58,10 @@ static const int fHaveUPnP = false; static const uint256 hashGenesisBlock("0x00000a060336cbb72fe969666d337b87198b1add2abaa59cca226820b32933a4"); static const uint256 hashGenesisBlockTestNet("0x000c763e402f2436da9ed36c7286f62c3f6e5dbafce9ff289bd43d7459327eb"); - static const int64 nMaxClockDrift = 2 * 60 * 60; // two hours +extern libzerocoin::Params* ZCParams; extern CScript COINBASE_FLAGS; - - extern CCriticalSection cs_main; extern std::map mapBlockIndex; extern std::set > setStakeSeen; @@ -89,11 +88,11 @@ extern std::map mapOrphanBlocks; // Settings extern int64 nTransactionFee; extern bool fStakeUsePooledKeys; +extern unsigned int nDerivationMethodIndex; // Minimum disk space required - used in CheckDiskSpace() static const uint64 nMinDiskSpace = 52428800; - class CReserveKey; class CTxDB; class CTxIndex; @@ -111,12 +110,9 @@ CBlockIndex* FindBlockByHeight(int nHeight); bool ProcessMessages(CNode* pfrom); bool SendMessages(CNode* pto, bool fSendTrickle); bool LoadExternalBlockFile(FILE* fileIn); -CBlock* CreateNewBlock(CWallet* pwallet, bool fProofOfStake=false); -void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce); -void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1); -bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey); -bool CheckStake(CBlock* pblock, CWallet& wallet); + bool CheckProofOfWork(uint256 hash, unsigned int nBits); +unsigned int GetNextTargetRequired(const CBlockIndex* pindexLast, bool fProofOfStake); int64 GetProofOfWorkReward(unsigned int nBits); int64 GetProofOfStakeReward(int64 nCoinAge, unsigned int nBits, unsigned int nTime, bool bCoinYearOnly=false); unsigned int ComputeMinWork(unsigned int nBase, int64 nTime); @@ -596,7 +592,7 @@ public: return dPriority > COIN * 144 / 250; } - int64 GetMinFee(unsigned int nBlockSize=1, bool fAllowFree=false, enum GetMinFee_mode mode=GMF_BLOCK) const; + int64 GetMinFee(unsigned int nBlockSize=1, bool fAllowFree=false, enum GetMinFee_mode mode=GMF_BLOCK, unsigned int nBytes = 0) const; bool ReadFromDisk(CDiskTxPos pos, FILE** pfileRet=NULL) { @@ -856,7 +852,6 @@ public: // memory only mutable std::vector vMerkleTree; - uint256 hashBlock; // Denial-of-service detection: mutable int nDoS; @@ -902,7 +897,6 @@ public: vchBlockSig.clear(); vMerkleTree.clear(); nDoS = 0; - hashBlock = 0; } bool IsNull() const @@ -910,7 +904,7 @@ public: return (nBits == 0); } - uint256 GetHash(bool fRehash=false) const + uint256 GetHash() const { return scrypt_blockhash(CVOIDBEGIN(nVersion)); }