Changeset View
Changeset View
Standalone View
Standalone View
src/txdb.h
Show All 9 Lines | |||||
#include "coins.h" | #include "coins.h" | ||||
#include "dbwrapper.h" | #include "dbwrapper.h" | ||||
#include <map> | #include <map> | ||||
#include <string> | #include <string> | ||||
#include <utility> | #include <utility> | ||||
#include <vector> | #include <vector> | ||||
#include <boost/function.hpp> | |||||
class CBlockIndex; | class CBlockIndex; | ||||
class CCoinsViewDBCursor; | class CCoinsViewDBCursor; | ||||
class uint256; | class uint256; | ||||
//! Compensate for extra memory peak (x1.5-x1.9) at flush time. | //! Compensate for extra memory peak (x1.5-x1.9) at flush time. | ||||
static constexpr int DB_PEAK_USAGE_FACTOR = 2; | static constexpr int DB_PEAK_USAGE_FACTOR = 2; | ||||
//! No need to periodic flush if at least this much space still available. | //! No need to periodic flush if at least this much space still available. | ||||
static constexpr int MAX_BLOCK_COINSDB_USAGE = 200 * DB_PEAK_USAGE_FACTOR; | static constexpr int MAX_BLOCK_COINSDB_USAGE = 200 * DB_PEAK_USAGE_FACTOR; | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | public: | ||||
bool ReadLastBlockFile(int &nFile); | bool ReadLastBlockFile(int &nFile); | ||||
bool WriteReindexing(bool fReindex); | bool WriteReindexing(bool fReindex); | ||||
bool ReadReindexing(bool &fReindex); | bool ReadReindexing(bool &fReindex); | ||||
bool ReadTxIndex(const uint256 &txid, CDiskTxPos &pos); | bool ReadTxIndex(const uint256 &txid, CDiskTxPos &pos); | ||||
bool WriteTxIndex(const std::vector<std::pair<uint256, CDiskTxPos>> &list); | bool WriteTxIndex(const std::vector<std::pair<uint256, CDiskTxPos>> &list); | ||||
bool WriteFlag(const std::string &name, bool fValue); | bool WriteFlag(const std::string &name, bool fValue); | ||||
bool ReadFlag(const std::string &name, bool &fValue); | bool ReadFlag(const std::string &name, bool &fValue); | ||||
bool LoadBlockIndexGuts( | bool LoadBlockIndexGuts( | ||||
boost::function<CBlockIndex *(const uint256 &)> insertBlockIndex); | std::function<CBlockIndex *(const uint256 &)> insertBlockIndex); | ||||
}; | }; | ||||
#endif // BITCOIN_TXDB_H | #endif // BITCOIN_TXDB_H |