Changeset View
Changeset View
Standalone View
Standalone View
src/index/txindex.cpp
Show First 20 Lines • Show All 232 Lines • ▼ Show 20 Lines | |||||
TxIndex::~TxIndex() {} | TxIndex::~TxIndex() {} | ||||
bool TxIndex::Init() { | bool TxIndex::Init() { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
// Attempt to migrate txindex from the old database to the new one. Even if | // Attempt to migrate txindex from the old database to the new one. Even if | ||||
// chain_tip is null, the node could be reindexing and we still want to | // chain_tip is null, the node could be reindexing and we still want to | ||||
// delete txindex records in the old database. | // delete txindex records in the old database. | ||||
if (!m_db->MigrateData(*pblocktree, chainActive.GetLocator())) { | if (!m_db->MigrateData(*pblocktree, ::ChainActive().GetLocator())) { | ||||
return false; | return false; | ||||
} | } | ||||
return BaseIndex::Init(); | return BaseIndex::Init(); | ||||
} | } | ||||
bool TxIndex::WriteBlock(const CBlock &block, const CBlockIndex *pindex) { | bool TxIndex::WriteBlock(const CBlock &block, const CBlockIndex *pindex) { | ||||
// Exclude genesis block transaction because outputs are not spendable. | // Exclude genesis block transaction because outputs are not spendable. | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |