From 95c7db3dbf4012dd02e5f1f30e6d982341facaa6 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 22 May 2013 20:58:53 +0200 Subject: 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. --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.cpp') 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); -- cgit v1.2.3