mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-04 20:51:27 +02:00
More bestblock records in wallets
Write bestblock records in wallets: * Every 20160 blocks synced, no matter what (before: none during IBD) * Every 144 blocks after IBD (before: for every block, slow) * When creating a new wallet * At shutdown This should result in far fewer spurious rescans.
This commit is contained in:
@ -100,6 +100,7 @@ void Shutdown()
|
||||
StopNode();
|
||||
{
|
||||
LOCK(cs_main);
|
||||
pwalletMain->SetBestChain(CBlockLocator(pindexBest));
|
||||
if (pblocktree)
|
||||
pblocktree->Flush();
|
||||
if (pcoinsTip)
|
||||
@ -998,6 +999,8 @@ bool AppInit2(boost::thread_group& threadGroup)
|
||||
if (!pwalletMain->SetAddressBookName(pwalletMain->vchDefaultKey.GetID(), ""))
|
||||
strErrors << _("Cannot write default address") << "\n";
|
||||
}
|
||||
|
||||
pwalletMain->SetBestChain(CBlockLocator(pindexBest));
|
||||
}
|
||||
|
||||
printf("%s", strErrors.str().c_str());
|
||||
|
Reference in New Issue
Block a user