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 1622404
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2413,6 +2413,9 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex *pindexStart, bool f

std::string wcdate = GetArg("-wcdate", "");
CBlockIndex* 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 +2428,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 1622404

Please sign in to comment.