Changeset View
Changeset View
Standalone View
Standalone View
src/index/txindex.cpp
Show First 20 Lines • Show All 260 Lines • ▼ Show 20 Lines | bool TxIndex::WriteBlock(const CBlock &block, const CBlockIndex *pindex) { | ||||
} | } | ||||
return m_db->WriteTxs(vPos); | return m_db->WriteTxs(vPos); | ||||
} | } | ||||
BaseIndex::DB &TxIndex::GetDB() const { | BaseIndex::DB &TxIndex::GetDB() const { | ||||
return *m_db; | return *m_db; | ||||
} | } | ||||
bool TxIndex::FindTx(const TxId &txid, uint256 &block_hash, | bool TxIndex::FindTx(const TxId &txid, BlockHash &block_hash, | ||||
CTransactionRef &tx) const { | CTransactionRef &tx) const { | ||||
CDiskTxPos postx; | CDiskTxPos postx; | ||||
if (!m_db->ReadTxPos(txid, postx)) { | if (!m_db->ReadTxPos(txid, postx)) { | ||||
return false; | return false; | ||||
} | } | ||||
CAutoFile file(OpenBlockFile(postx, true), SER_DISK, CLIENT_VERSION); | CAutoFile file(OpenBlockFile(postx, true), SER_DISK, CLIENT_VERSION); | ||||
if (file.IsNull()) { | if (file.IsNull()) { | ||||
Show All 18 Lines |