Clean issues which some LLVM configurations don't like
[novacoin.git] / src / wallet.h
index 3522cc8..e5aa73b 100644 (file)
@@ -18,6 +18,7 @@
 #include "util.h"
 #include "walletdb.h"
 
+extern unsigned int nStakeMaxAge;
 extern bool fWalletUnlockMintOnly;
 extern bool fConfChange;
 class CAccountingEntry;
@@ -83,6 +84,10 @@ private:
     // selected coins metadata
     std::map<std::pair<uint256, unsigned int>, std::pair<std::pair<CTxIndex, std::pair<const CWalletTx*,unsigned int> >, std::pair<CBlock, uint64> > > mapMeta;
 
+    // stake mining statistics
+    uint64 nKernelsTried;
+    uint64 nCoinDaysTried;
+
 public:
     mutable CCriticalSection cs_wallet;
 
@@ -105,6 +110,8 @@ public:
         nMasterKeyMaxID = 0;
         pwalletdbEncryption = NULL;
         nOrderPosNext = 0;
+        nKernelsTried = 0;
+        nCoinDaysTried = 0;
     }
     CWallet(std::string strWalletFileIn)
     {
@@ -115,9 +122,12 @@ public:
         nMasterKeyMaxID = 0;
         pwalletdbEncryption = NULL;
         nOrderPosNext = 0;
+        nKernelsTried = 0;
+        nCoinDaysTried = 0;
     }
 
     std::map<uint256, CWalletTx> mapWallet;
+    std::vector<uint256> vMintingWalletUpdated;
     int64 nOrderPosNext;
     std::map<uint256, int> mapRequestCount;
 
@@ -181,6 +191,7 @@ public:
     bool AddToWallet(const CWalletTx& wtxIn);
     bool AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate = false, bool fFindBlock = false);
     bool EraseFromWallet(uint256 hash);
+    void ClearOrphans();
     void WalletUpdateSpent(const CTransaction& prevout, bool fBlock = false);
     int ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate = false);
     int ScanForWalletTransaction(const uint256& hashTx);
@@ -200,7 +211,7 @@ public:
     bool CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet, const CCoinControl *coinControl=NULL);
     bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey);
 
-    bool GetStakeWeight(const CKeyStore& keystore, uint64& nMinWeight, uint64& nMaxWeight, uint64& nWeight);
+    void GetStakeStats(float &nKernelsRate, float &nCoinDaysRate);
     void GetStakeWeightFromValue(const int64& nTime, const int64& nValue, uint64& nWeight);
     bool CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int64 nSearchInterval, CTransaction& txNew, CKey& key);
     bool MergeCoins(const int64& nAmount, const int64& nMinValue, const int64& nMaxValue, std::list<uint256>& listMerged);