diff --git a/src/init.cpp b/src/init.cpp index 431c533a8..ad3570871 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -383,7 +383,7 @@ bool AppInit2(int argc, char* argv[]) { printf("Rescanning last %i blocks (from block %i)...\n", pindexBest->nHeight - pindexRescan->nHeight, pindexRescan->nHeight); nStart = GetTimeMillis(); - ScanForWalletTransactions(pindexRescan); + ScanForWalletTransactions(pindexRescan, true); printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart); } diff --git a/src/main.cpp b/src/main.cpp index 68b6b4ee1..f030eed65 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -884,7 +884,7 @@ bool CWalletTx::AcceptWalletTransaction(CTxDB& txdb, bool fCheckInputs) return false; } -int ScanForWalletTransactions(CBlockIndex* pindexStart) +int ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate) { int ret = 0; @@ -897,7 +897,7 @@ int ScanForWalletTransactions(CBlockIndex* pindexStart) block.ReadFromDisk(pindex, true); BOOST_FOREACH(CTransaction& tx, block.vtx) { - if (AddToWalletIfInvolvingMe(tx, &block)) + if (AddToWalletIfInvolvingMe(tx, &block, fUpdate)) ret++; } pindex = pindex->pnext; diff --git a/src/main.h b/src/main.h index 92b73fe5a..a49966b4d 100644 --- a/src/main.h +++ b/src/main.h @@ -86,7 +86,7 @@ bool AddKey(const CKey& key); std::vector GenerateNewKey(); bool AddToWallet(const CWalletTx& wtxIn); void WalletUpdateSpent(const COutPoint& prevout); -int ScanForWalletTransactions(CBlockIndex* pindexStart); +int ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate = false); void ReacceptWalletTransactions(); bool LoadBlockIndex(bool fAllowNew=true); void PrintBlockTree();