diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2024-09-25 15:42:51 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2024-10-01 09:12:32 +0200 |
commit | fa22e5c430acaef9713d9a4b4b97bb3f4876f816 (patch) | |
tree | c3439083b00d24d6ccd89e7f8e5be02036b9d391 /src | |
parent | fa2e4439652172df27f14508eef078bd0ee2fca5 (diff) |
refactor: Remove dead code that assumed tip == nullptr
The tip is set after waiting for the genesis block.
Diffstat (limited to 'src')
-rw-r--r-- | src/init.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/init.cpp b/src/init.cpp index 307a339aee..bf268d418c 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1811,17 +1811,17 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) // ********************************************************* Step 12: start node - //// debug print 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()); - chain_active_height = chainman.ActiveChain().Height(); - best_block_time = chainman.ActiveChain().Tip() ? chainman.ActiveChain().Tip()->GetBlockTime() : chainman.GetParams().GenesisBlock().GetBlockTime(); + chain_active_height = tip.nHeight; + best_block_time = tip.GetBlockTime(); if (tip_info) { tip_info->block_height = chain_active_height; 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) { tip_info->header_height = chainman.m_best_header->nHeight; |