From 1c528eeee939cacc0c100e5ca1e2d4ddb3c50227 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 22 May 2011 17:12:20 +0200 Subject: Update transactions already in the wallet when rescanning. When rescanning, if the scanned transaction is already in the wallet, it is skipped. However, if someone sends a transaction, does not wait for confirmation, switches wallets, waits for a block that contains his original transaction, and switches wallets again, a rescan will leave his wallet transaction (which has no merkle branch, so no confirmations) untouched. --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 68b6b4ee1b..f030eed651 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; -- cgit v1.2.3