mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user