Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
•All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
txdb.h
Go to the documentation of this file.
57 CDiskTxPos(const CDiskBlockPos &blockIn, unsigned int nTxOffsetIn) : CDiskBlockPos(blockIn.nFile, blockIn.nPos), nTxOffset(nTxOffsetIn) {
126 bool WriteBatchSync(const std::vector<std::pair<int, const CBlockFileInfo*> >& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo);
136 bool UpdateAddressUnspentIndex(const std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue > >&vect);
145 bool ReadTimestampIndex(const unsigned int &high, const unsigned int &low, std::vector<uint256> &vect);
148 bool LoadBlockIndexGuts(const Consensus::Params& consensusParams, std::function<CBlockIndex*(const uint256&)> insertBlockIndex);
void SerializationOp(Stream &s, Operation ser_action)
Definition: txdb.h:52
bool GetCoin(const COutPoint &outpoint, Coin &coin) const override
Retrieve the Coin (unspent transaction output) for a given outpoint.
Definition: txdb.cpp:65
Definition: chain.h:85
Definition: dbwrapper.h:126
bool Upgrade()
Attempt to update from an older database format. Returns whether an error occurred.
Definition: txdb.cpp:518
Specialization of CCoinsViewCursor to iterate over a CCoinsViewDB.
Definition: txdb.h:92
CBlockTreeDB & operator=(const CBlockTreeDB &)=delete
bool ReadTimestampIndex(const unsigned int &high, const unsigned int &low, std::vector< uint256 > &vect)
Definition: txdb.cpp:384
Definition: dbwrapper.h:197
static const int64_t nMaxBlockDBAndTxIndexCache
Max memory allocated to block tree DB specific cache, if -txindex (MiB)
Definition: txdb.h:41
bool ReadAddressIndex(uint160 addressHash, int type, std::vector< std::pair< CAddressIndexKey, CAmount > > &addressIndex, int start=0, int end=0)
Definition: txdb.cpp:344
bool ReadSpentIndex(CSpentIndexKey &key, CSpentIndexValue &value)
Definition: txdb.cpp:276
static constexpr int MAX_BLOCK_COINSDB_USAGE
No need to periodic flush if at least this much space still available.
Definition: txdb.h:27
Definition: txdb.h:45
bool EraseAddressIndex(const std::vector< std::pair< CAddressIndexKey, CAmount > > &vect)
Definition: txdb.cpp:337
bool UpdateAddressUnspentIndex(const std::vector< std::pair< CAddressUnspentKey, CAddressUnspentValue > > &vect)
Definition: txdb.cpp:292
bool ReadAddressUnspentIndex(uint160 addressHash, int type, std::vector< std::pair< CAddressUnspentKey, CAddressUnspentValue > > &vect)
Definition: txdb.cpp:304
bool WriteTimestampIndex(const CTimestampIndexKey ×tampIndex)
Definition: txdb.cpp:378
std::unordered_map< COutPoint, CCoinsCacheEntry, SaltedOutpointHasher > CCoinsMap
Definition: coins.h:122
Definition: spentindex.h:133
CCoinsViewDBCursor(CDBIterator *pcursorIn, const uint256 &hashBlockIn)
Definition: txdb.h:105
CDiskTxPos(const CDiskBlockPos &blockIn, unsigned int nTxOffsetIn)
Definition: txdb.h:57
size_t EstimateSize() const override
Estimate database size (0 if not implemented)
Definition: txdb.cpp:149
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition: transaction.h:26
bool WriteAddressIndex(const std::vector< std::pair< CAddressIndexKey, CAmount > > &vect)
Definition: txdb.cpp:330
bool HaveCoin(const COutPoint &outpoint) const override
Just check whether a given outpoint is unspent.
Definition: txdb.cpp:69
CBlockTreeDB(size_t nCacheSize, bool fMemory=false, bool fWipe=false)
Definition: txdb.cpp:154
bool WriteBatchSync(const std::vector< std::pair< int, const CBlockFileInfo *> > &fileInfo, int nLastFile, const std::vector< const CBlockIndex *> &blockinfo)
Definition: txdb.cpp:231
bool ReadBlockFileInfo(int nFile, CBlockFileInfo &info)
Definition: txdb.cpp:157
static const int64_t nMaxBlockDBCache
Max memory allocated to block tree DB specific cache, if no -txindex (MiB)
Definition: txdb.h:37
bool ReadTxIndex(const uint256 &txid, CDiskTxPos &pos)
Definition: txdb.cpp:257
Definition: spentindex.h:42
CCoinsViewDB(size_t nCacheSize, bool fMemory=false, bool fWipe=false)
Definition: txdb.cpp:61
uint256 GetBestBlock() const override
Retrieve the block hash whose state this CCoinsView currently represents.
Definition: txdb.cpp:73
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition: chain.h:170
static const int64_t nMaxCoinsDBCache
Max memory allocated to coin DB specific cache (MiB)
Definition: txdb.h:43
Definition: spentindex.h:14
bool LoadBlockIndexGuts(const Consensus::Params &consensusParams, std::function< CBlockIndex *(const uint256 &)> insertBlockIndex)
Definition: txdb.cpp:416
bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) override
Do a bulk modification (multiple Coin changes + BestBlock change).
Definition: txdb.cpp:88
CCoinsViewCursor * Cursor() const override
Get a cursor to iterate over the whole state.
Definition: txdb.cpp:177
unordered_limitedmap< uint256, bool > mapHasTxIndexCache
Definition: txdb.h:118
bool UpdateSpentIndex(const std::vector< std::pair< CSpentIndexKey, CSpentIndexValue > > &vect)
Definition: txdb.cpp:280
Definition: chain.h:31
std::vector< uint256 > GetHeadBlocks() const override
Retrieve the range of blocks that may have been only partially written.
Definition: txdb.cpp:80
bool WriteTxIndex(const std::vector< std::pair< uint256, CDiskTxPos > > &vect)
Definition: txdb.cpp:264
Wrapped mutex: supports recursive locking, but no waiting TODO: We should move away from using the re...
Definition: sync.h:94