aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2013-05-22 14:01:31 -0700
committerGregory Maxwell <greg@xiph.org>2013-05-22 14:01:31 -0700
commit95c2ba168941958087d5dc7f1e3c9a89bb19f602 (patch)
tree3c0114a3d892fa3269e081790a7a304f683050cf /src
parent0c4434cf776af7b84cfca50360da87feeeb53d1e (diff)
parent95c7db3dbf4012dd02e5f1f30e6d982341facaa6 (diff)
Merge pull request #2682 from sipa/morewalletbb
More bestblock records in wallets
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp3
-rw-r--r--src/main.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp
index d619cb4121..ebd9dee7b2 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -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());
diff --git a/src/main.cpp b/src/main.cpp
index 2d22541baf..b7efac53b1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -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);