diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 0a5bf92603..5875c7f47a 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -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) { @@ -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)))