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 996878d
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];
mnemonicStartBlock = chainActive[chainParams.GetConsensus().nMnemonicBlock];
if (mnemonicStartBlock == NULL)
mnemonicStartBlock = 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 996878d

Please sign in to comment.