mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
Automatically reorganize at startup to best known block
Given that the block tree database (chain.dat) and the active chain database (coins.dat) are entirely separate now, it becomes legal to swap one with another instance without affecting the other. This commit introduces a check in the startup code that detects the presence of a better chain in chain.dat that has not been activated yet, and does so efficiently (in batch, while reusing the blk???.dat files).
This commit is contained in:
parent
13c51f20f6
commit
4fea06db25
2 changed files with 34 additions and 1 deletions
|
|
@ -636,7 +636,6 @@ bool LoadBlockIndex(CChainDB &chaindb)
|
|||
{
|
||||
if (pindexGenesisBlock == NULL)
|
||||
return true;
|
||||
return error("CTxDB::LoadBlockIndex() : hashBestChain not loaded");
|
||||
}
|
||||
hashBestChain = pindexBest->GetBlockHash();
|
||||
nBestHeight = pindexBest->nHeight;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue