Skip to content

Commit

Permalink
Merge pull request dogecoin#2682 from sipa/morewalletbb
Browse files Browse the repository at this point in the history
More bestblock records in wallets
gmaxwell committed May 22, 2013

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 0c4434c + 95c7db3 commit 95c2ba1
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
@@ -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());
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
@@ -1870,7 +1870,7 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
}

// Update best block in wallet (so we can detect restored wallets)
if (!fIsInitialDownload)
if ((pindexNew->nHeight % 20160) == 0 || (!fIsInitialDownload && (pindexNew->nHeight % 144) == 0))
{
const CBlockLocator locator(pindexNew);
::SetBestChain(locator);

0 comments on commit 95c2ba1

Please sign in to comment.