mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge a822a0e4f6 into merged_master (Bitcoin PR #15999)
This commit is contained in:
commit
e6adc4efa2
1 changed files with 1 additions and 11 deletions
|
|
@ -4246,20 +4246,10 @@ bool static LoadBlockIndexDB(const CChainParams& chainparams) EXCLUSIVE_LOCKS_RE
|
|||
bool LoadChainTip(const CChainParams& chainparams)
|
||||
{
|
||||
AssertLockHeld(cs_main);
|
||||
assert(!pcoinsTip->GetBestBlock().IsNull()); // Never called when the coins view is empty
|
||||
|
||||
if (::ChainActive().Tip() && ::ChainActive().Tip()->GetBlockHash() == pcoinsTip->GetBestBlock()) return true;
|
||||
|
||||
if (pcoinsTip->GetBestBlock().IsNull() && mapBlockIndex.size() == 1) {
|
||||
// In case we just added the genesis block, connect it now, so
|
||||
// that we always have a ::ChainActive().Tip() when we return.
|
||||
LogPrintf("%s: Connecting genesis block...\n", __func__);
|
||||
CValidationState state;
|
||||
if (!ActivateBestChain(state, chainparams)) {
|
||||
LogPrintf("%s: failed to activate chain (%s)\n", __func__, FormatStateMessage(state));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Load pointer to end of best chain
|
||||
CBlockIndex* pindex = LookupBlockIndex(pcoinsTip->GetBestBlock());
|
||||
if (!pindex) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue