aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@exmulti.com>2011-06-05 07:30:47 -0700
committerJeff Garzik <jgarzik@exmulti.com>2011-06-05 07:30:47 -0700
commit7a234cdae512bea68af2cc8e6a9ffcc665ddc820 (patch)
tree8ae0801982c5beef5db9e0e9180ed50747fc9061
parent39105dac1b2880970cab3d8f1af969a4b803df01 (diff)
parent1c528eeee939cacc0c100e5ca1e2d4ddb3c50227 (diff)
Merge pull request #255 from sipa/rescanupdate
Update transactions already in the wallet when rescanning.
-rw-r--r--src/init.cpp2
-rw-r--r--src/main.cpp4
-rw-r--r--src/main.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 431c533a83..ad35708710 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 793cf77f10..6f3ef62deb 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 117a084756..8d9b39f718 100644
--- a/src/main.h
+++ b/src/main.h
@@ -87,7 +87,7 @@ bool AddKey(const CKey& key);
std::vector<unsigned char> 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();