class CAddrMan;
class CBlockLocator;
class CDiskBlockIndex;
-class CDiskTxPos;
class CMasterKey;
class COutPoint;
-class CTxIndex;
class CWallet;
class CWalletTx;
bool fDbEnvInit;
bool fMockDb;
boost::filesystem::path pathEnv;
- std::string strPath;
void EnvShutdown();
};
+
+
+
+
+
+/** Access to the transaction database (coins.dat) */
+class CCoinsDB : public CDB
+{
+public:
+ CCoinsDB(const char* pszMode="r+") : CDB("coins.dat", pszMode) { }
+private:
+ CCoinsDB(const CCoinsDB&);
+ void operator=(const CCoinsDB&);
+public:
+ bool ReadCoins(uint256 hash, CCoins &coins);
+ bool WriteCoins(uint256 hash, const CCoins& coins);
+ bool HaveCoins(uint256 hash);
+ bool ReadHashBestChain(uint256& hashBestChain);
+ bool WriteHashBestChain(uint256 hashBestChain);
+};
+
+/** Access to the block database (chain.dat) */
+class CChainDB : public CDB
+{
+public:
+ CChainDB(const char* pszMode="r+") : CDB("chain.dat", pszMode) { }
+private:
+ CChainDB(const CChainDB&);
+ void operator=(const CChainDB&);
+public:
+ bool WriteBlockIndex(const CDiskBlockIndex& blockindex);
+ bool ReadBestInvalidTrust(CBigNum& bnBestInvalidTrust);
+ bool WriteBestInvalidTrust(CBigNum bnBestInvalidTrust);
+ bool ReadBlockFileInfo(int nFile, CBlockFileInfo &fileinfo);
+ bool WriteBlockFileInfo(int nFile, const CBlockFileInfo &fileinfo);
+ bool ReadLastBlockFile(int &nFile);
+ bool WriteLastBlockFile(int nFile);
+ bool ReadSyncCheckpoint(uint256& hashCheckpoint);
+ bool WriteSyncCheckpoint(uint256 hashCheckpoint);
+ bool ReadCheckpointPubKey(std::string& strPubKey);
+ bool WriteCheckpointPubKey(const std::string& strPubKey);
+ bool LoadBlockIndexGuts();
+};
+
+
+bool LoadBlockIndex(CCoinsDB &coinsdb, CChainDB &chaindb);
+
+
/** Access to the (IP) address database (peers.dat) */
class CAddrDB
{