mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-10 23:07:52 +00:00
Merge pull request #2603 from sipa/nobestblock
Bugfix: if no bestblock record is present, do a -rescan
This commit is contained in:
commit
aa6b3061ee
@ -987,6 +987,8 @@ bool AppInit2(boost::thread_group& threadGroup)
|
||||
CBlockLocator locator;
|
||||
if (walletdb.ReadBestBlock(locator))
|
||||
pindexRescan = locator.GetBlockIndex();
|
||||
else
|
||||
pindexRescan = pindexGenesisBlock;
|
||||
}
|
||||
if (pindexBest && pindexBest != pindexRescan)
|
||||
{
|
||||
@ -995,6 +997,8 @@ bool AppInit2(boost::thread_group& threadGroup)
|
||||
nStart = GetTimeMillis();
|
||||
pwalletMain->ScanForWalletTransactions(pindexRescan, true);
|
||||
printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart);
|
||||
pwalletMain->SetBestChain(CBlockLocator(pindexBest));
|
||||
nWalletDBUpdated++;
|
||||
}
|
||||
|
||||
// ********************************************************* Step 9: import blocks
|
||||
|
Loading…
Reference in New Issue
Block a user