From e3a5059c18fe5f6e104ec868e8ba9af374603363 Mon Sep 17 00:00:00 2001 From: Tranz5 Date: Tue, 27 May 2014 22:34:58 -0400 Subject: [PATCH] ScanForWalletTransactions fix Don't scan if the wallet birthday is newer then blocks --- src/wallet.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/wallet.cpp b/src/wallet.cpp index 1823322..1b26b31 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -853,6 +853,14 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate) LOCK(cs_wallet); while (pindex) { + // no need to read and scan block, if block was created before + // our wallet birthday (as adjusted for block time variability) + if (nTimeFirstKey && (pindex->nTime < (nTimeFirstKey - 7200))) + { + pindex = pindex->pnext; + continue; + + } CBlock block; block.ReadFromDisk(pindex, true); BOOST_FOREACH(CTransaction& tx, block.vtx)