Skip to content

Commit

Permalink
scan optimisation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
levoncrypto committed Aug 19, 2024
1 parent b9da4df commit e19e0f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2413,6 +2413,10 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex *pindexStart, bool f

std::string wcdate = GetArg("-wcdate", "");
CBlockIndex* mnemonicStartBlock = chainActive[chainParams.GetConsensus().nMnemonicBlock];
pindex = chainActive[chainParams.GetConsensus().nMnemonicBlock];
if (pindex == NULL)
pindex = chainActive.Tip();

if (!wcdate.empty()) {
pindex = GetBlockByDate(mnemonicStartBlock, wcdate);
if (pindex->nHeight < chainParams.GetConsensus().nMnemonicBlock) {
Expand All @@ -2425,8 +2429,6 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex *pindexStart, bool f
pindex = chainActive.FindEarliestAtLeast(nTimeFirstKey);
else
pindex = mnemonicStartBlock;
if (pindex == NULL)
pindex = chainActive.Tip();
}
else
while (pindex && nTimeFirstKey && (pindex->GetBlockTime() < (nTimeFirstKey - 7200)))
Expand Down

0 comments on commit e19e0f6

Please sign in to comment.