diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 0a5bf92603..174768cce6 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]; + mnemonicStartBlock = chainActive[chainParams.GetConsensus().nMnemonicBlock]; + if (mnemonicStartBlock == NULL) + mnemonicStartBlock = 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)))