mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-19 09:53:47 +01:00
Index: Return early from failed coinstatsindex init
This commit is contained in:
parent
1e3842385b
commit
01386bfd88
@ -344,33 +344,31 @@ bool CoinStatsIndex::Init()
|
||||
}
|
||||
}
|
||||
|
||||
if (BaseIndex::Init()) {
|
||||
const CBlockIndex* pindex{CurrentIndex()};
|
||||
if (!BaseIndex::Init()) return false;
|
||||
|
||||
if (pindex) {
|
||||
DBVal entry;
|
||||
if (!LookUpOne(*m_db, pindex, entry)) {
|
||||
return false;
|
||||
}
|
||||
const CBlockIndex* pindex{CurrentIndex()};
|
||||
|
||||
m_transaction_output_count = entry.transaction_output_count;
|
||||
m_bogo_size = entry.bogo_size;
|
||||
m_total_amount = entry.total_amount;
|
||||
m_total_subsidy = entry.total_subsidy;
|
||||
m_total_unspendable_amount = entry.total_unspendable_amount;
|
||||
m_total_prevout_spent_amount = entry.total_prevout_spent_amount;
|
||||
m_total_new_outputs_ex_coinbase_amount = entry.total_new_outputs_ex_coinbase_amount;
|
||||
m_total_coinbase_amount = entry.total_coinbase_amount;
|
||||
m_total_unspendables_genesis_block = entry.total_unspendables_genesis_block;
|
||||
m_total_unspendables_bip30 = entry.total_unspendables_bip30;
|
||||
m_total_unspendables_scripts = entry.total_unspendables_scripts;
|
||||
m_total_unspendables_unclaimed_rewards = entry.total_unspendables_unclaimed_rewards;
|
||||
if (pindex) {
|
||||
DBVal entry;
|
||||
if (!LookUpOne(*m_db, pindex, entry)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
m_transaction_output_count = entry.transaction_output_count;
|
||||
m_bogo_size = entry.bogo_size;
|
||||
m_total_amount = entry.total_amount;
|
||||
m_total_subsidy = entry.total_subsidy;
|
||||
m_total_unspendable_amount = entry.total_unspendable_amount;
|
||||
m_total_prevout_spent_amount = entry.total_prevout_spent_amount;
|
||||
m_total_new_outputs_ex_coinbase_amount = entry.total_new_outputs_ex_coinbase_amount;
|
||||
m_total_coinbase_amount = entry.total_coinbase_amount;
|
||||
m_total_unspendables_genesis_block = entry.total_unspendables_genesis_block;
|
||||
m_total_unspendables_bip30 = entry.total_unspendables_bip30;
|
||||
m_total_unspendables_scripts = entry.total_unspendables_scripts;
|
||||
m_total_unspendables_unclaimed_rewards = entry.total_unspendables_unclaimed_rewards;
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Reverse a single block as part of a reorg
|
||||
|
Loading…
Reference in New Issue
Block a user