mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-09 10:43:19 -05:00
refactor: Remove dead code that assumed tip == nullptr
The tip is set after waiting for the genesis block.
This commit is contained in:
parent
fa2e443965
commit
fa22e5c430
1 changed files with 5 additions and 5 deletions
10
src/init.cpp
10
src/init.cpp
|
@ -1811,17 +1811,17 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||||
|
|
||||||
// ********************************************************* Step 12: start node
|
// ********************************************************* Step 12: start node
|
||||||
|
|
||||||
//// debug print
|
|
||||||
int64_t best_block_time{};
|
int64_t best_block_time{};
|
||||||
{
|
{
|
||||||
LOCK(cs_main);
|
LOCK(chainman.GetMutex());
|
||||||
|
const auto& tip{*Assert(chainman.ActiveTip())};
|
||||||
LogPrintf("block tree size = %u\n", chainman.BlockIndex().size());
|
LogPrintf("block tree size = %u\n", chainman.BlockIndex().size());
|
||||||
chain_active_height = chainman.ActiveChain().Height();
|
chain_active_height = tip.nHeight;
|
||||||
best_block_time = chainman.ActiveChain().Tip() ? chainman.ActiveChain().Tip()->GetBlockTime() : chainman.GetParams().GenesisBlock().GetBlockTime();
|
best_block_time = tip.GetBlockTime();
|
||||||
if (tip_info) {
|
if (tip_info) {
|
||||||
tip_info->block_height = chain_active_height;
|
tip_info->block_height = chain_active_height;
|
||||||
tip_info->block_time = best_block_time;
|
tip_info->block_time = best_block_time;
|
||||||
tip_info->verification_progress = GuessVerificationProgress(chainman.GetParams().TxData(), chainman.ActiveChain().Tip());
|
tip_info->verification_progress = GuessVerificationProgress(chainman.GetParams().TxData(), &tip);
|
||||||
}
|
}
|
||||||
if (tip_info && chainman.m_best_header) {
|
if (tip_info && chainman.m_best_header) {
|
||||||
tip_info->header_height = chainman.m_best_header->nHeight;
|
tip_info->header_height = chainman.m_best_header->nHeight;
|
||||||
|
|
Loading…
Add table
Reference in a new issue