aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-08-10 15:13:57 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2012-10-20 23:08:57 +0200
commit4fea06db25108e7f72710bf22c3d1896707eeb74 (patch)
treeef480d212b7da3b484bdb066453e874d2c5c6c84 /src/db.cpp
parent13c51f20f619b9001bb6caf225b8cd6c5c2fbb31 (diff)
downloadbitcoin-4fea06db25108e7f72710bf22c3d1896707eeb74.tar.xz
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).
Diffstat (limited to 'src/db.cpp')
-rw-r--r--src/db.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/db.cpp b/src/db.cpp
index 06e5543b2e..5ca9ea2c34 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -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;