Changeset View
Changeset View
Standalone View
Standalone View
src/index/coinstatsindex.cpp
Show First 20 Lines • Show All 386 Lines • ▼ Show 20 Lines | bool CoinStatsIndex::Init() { | ||||
if (pindex) { | if (pindex) { | ||||
DBVal entry; | DBVal entry; | ||||
if (!LookUpOne(*m_db, pindex, entry)) { | if (!LookUpOne(*m_db, pindex, entry)) { | ||||
return error( | return error( | ||||
"%s: Cannot read current %s state; index may be corrupted", | "%s: Cannot read current %s state; index may be corrupted", | ||||
__func__, GetName()); | __func__, GetName()); | ||||
} | } | ||||
uint256 out; | |||||
m_muhash.Finalize(out); | |||||
if (entry.muhash != out) { | |||||
return error( | |||||
"%s: Cannot read current %s state; index may be corrupted", | |||||
__func__, GetName()); | |||||
} | |||||
m_transaction_output_count = entry.transaction_output_count; | m_transaction_output_count = entry.transaction_output_count; | ||||
m_bogo_size = entry.bogo_size; | m_bogo_size = entry.bogo_size; | ||||
m_total_amount = entry.total_amount; | m_total_amount = entry.total_amount; | ||||
m_total_subsidy = entry.total_subsidy; | m_total_subsidy = entry.total_subsidy; | ||||
m_total_unspendable_amount = entry.total_unspendable_amount; | m_total_unspendable_amount = entry.total_unspendable_amount; | ||||
m_total_prevout_spent_amount = entry.total_prevout_spent_amount; | m_total_prevout_spent_amount = entry.total_prevout_spent_amount; | ||||
m_total_new_outputs_ex_coinbase_amount = | m_total_new_outputs_ex_coinbase_amount = | ||||
entry.total_new_outputs_ex_coinbase_amount; | entry.total_new_outputs_ex_coinbase_amount; | ||||
▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines |