Changeset View
Changeset View
Standalone View
Standalone View
src/txdb.cpp
Show First 20 Lines • Show All 534 Lines • ▼ Show 20 Lines | bool TxIndexDB::MigrateData(CBlockTreeDB &block_tree_db, | ||||
CBlockLocator locator; | CBlockLocator locator; | ||||
if (!block_tree_db.Read(DB_TXINDEX_BLOCK, locator)) { | if (!block_tree_db.Read(DB_TXINDEX_BLOCK, locator)) { | ||||
return true; | return true; | ||||
} | } | ||||
int64_t count = 0; | int64_t count = 0; | ||||
LogPrintf("Upgrading txindex database... [0%%]\n"); | LogPrintf("Upgrading txindex database... [0%%]\n"); | ||||
uiInterface.InitMessage(_("Upgrading txindex database")); | |||||
uiInterface.ShowProgress(_("Upgrading txindex database"), 0, true); | uiInterface.ShowProgress(_("Upgrading txindex database"), 0, true); | ||||
int report_done = 0; | int report_done = 0; | ||||
const size_t batch_size = 1 << 24; // 16 MiB | const size_t batch_size = 1 << 24; // 16 MiB | ||||
CDBBatch batch_newdb(*this); | CDBBatch batch_newdb(*this); | ||||
CDBBatch batch_olddb(block_tree_db); | CDBBatch batch_olddb(block_tree_db); | ||||
std::pair<unsigned char, uint256> key; | std::pair<unsigned char, uint256> key; | ||||
▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines |