change #8775 to keep dash codebase improvement, but still backport #9908

This commit is contained in:
Pasta 2018-12-30 16:03:10 -06:00
parent afdb0a2677
commit c70aa60792

View File

@ -513,13 +513,7 @@ UniValue importwallet(const JSONRPCRequest& request)
file.close(); file.close();
pwallet->ShowProgress("", 100); // hide progress dialog in GUI pwallet->ShowProgress("", 100); // hide progress dialog in GUI
CBlockIndex *pindex = chainActive.Tip(); CBlockIndex* pindex = chainActive.FindEarliestAtLeast(nTimeBegin - TIMESTAMP_WINDOW);
while (pindex && pindex->pprev && pindex->GetBlockTime() > nTimeBegin - TIMESTAMP_WINDOW)
pindex = pindex->pprev;
pwallet->UpdateTimeFirstKey(nTimeBegin);
CBlockIndex *pindex = chainActive.FindEarliestAtLeast(nTimeBegin - 7200);
LogPrintf("Rescanning last %i blocks\n", chainActive.Height() - pindex->nHeight + 1); LogPrintf("Rescanning last %i blocks\n", chainActive.Height() - pindex->nHeight + 1);
pwallet->ScanForWalletTransactions(pindex); pwallet->ScanForWalletTransactions(pindex);