mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
Wallet: optimize rescan to skip blocks prior to birthday
This commit is contained in:
parent
3869fb89b6
commit
8da9dd0725
@ -790,6 +790,13 @@ 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->GetNextInMainChain();
|
||||
continue;
|
||||
}
|
||||
|
||||
CBlock block;
|
||||
block.ReadFromDisk(pindex);
|
||||
BOOST_FOREACH(CTransaction& tx, block.vtx)
|
||||
|
Loading…
Reference in New Issue
Block a user