@@ -344,33 +344,31 @@ bool CoinStatsIndex::Init()
344
344
}
345
345
}
346
346
347
- if (BaseIndex::Init ()) {
348
- const CBlockIndex* pindex{CurrentIndex ()};
347
+ if (!BaseIndex::Init ()) return false ;
349
348
350
- if (pindex) {
351
- DBVal entry;
352
- if (!LookUpOne (*m_db, pindex, entry)) {
353
- return false ;
354
- }
349
+ const CBlockIndex* pindex{CurrentIndex ()};
355
350
356
- m_transaction_output_count = entry.transaction_output_count ;
357
- m_bogo_size = entry.bogo_size ;
358
- m_total_amount = entry.total_amount ;
359
- m_total_subsidy = entry.total_subsidy ;
360
- m_total_unspendable_amount = entry.total_unspendable_amount ;
361
- m_total_prevout_spent_amount = entry.total_prevout_spent_amount ;
362
- m_total_new_outputs_ex_coinbase_amount = entry.total_new_outputs_ex_coinbase_amount ;
363
- m_total_coinbase_amount = entry.total_coinbase_amount ;
364
- m_total_unspendables_genesis_block = entry.total_unspendables_genesis_block ;
365
- m_total_unspendables_bip30 = entry.total_unspendables_bip30 ;
366
- m_total_unspendables_scripts = entry.total_unspendables_scripts ;
367
- m_total_unspendables_unclaimed_rewards = entry.total_unspendables_unclaimed_rewards ;
351
+ if (pindex) {
352
+ DBVal entry;
353
+ if (!LookUpOne (*m_db, pindex, entry)) {
354
+ return false ;
368
355
}
369
356
370
- return true ;
357
+ m_transaction_output_count = entry.transaction_output_count ;
358
+ m_bogo_size = entry.bogo_size ;
359
+ m_total_amount = entry.total_amount ;
360
+ m_total_subsidy = entry.total_subsidy ;
361
+ m_total_unspendable_amount = entry.total_unspendable_amount ;
362
+ m_total_prevout_spent_amount = entry.total_prevout_spent_amount ;
363
+ m_total_new_outputs_ex_coinbase_amount = entry.total_new_outputs_ex_coinbase_amount ;
364
+ m_total_coinbase_amount = entry.total_coinbase_amount ;
365
+ m_total_unspendables_genesis_block = entry.total_unspendables_genesis_block ;
366
+ m_total_unspendables_bip30 = entry.total_unspendables_bip30 ;
367
+ m_total_unspendables_scripts = entry.total_unspendables_scripts ;
368
+ m_total_unspendables_unclaimed_rewards = entry.total_unspendables_unclaimed_rewards ;
371
369
}
372
370
373
- return false ;
371
+ return true ;
374
372
}
375
373
376
374
// Reverse a single block as part of a reorg
0 commit comments