Skip to content

Commit

Permalink
ScanForWalletTransactions fix
Browse files Browse the repository at this point in the history
Don't scan if the wallet birthday is newer then blocks
  • Loading branch information
Tranz5 committed May 28, 2014
1 parent 5c1022d commit e3a5059
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e3a5059

Please sign in to comment.