Skip to content

Commit 3c292cc

Browse files
committed
ScanforWalletTransactions should mark input txns as dirty
1 parent 7c32b41 commit 3c292cc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/wallet/wallet.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,10 +1214,10 @@ void CWallet::MarkConflicted(const uint256& hashBlock, const uint256& hashTx)
12141214
}
12151215
}
12161216

1217-
void CWallet::SyncTransaction(const CTransactionRef& ptx, const CBlockIndex *pindex, int posInBlock) {
1217+
void CWallet::SyncTransaction(const CTransactionRef& ptx, const CBlockIndex *pindex, int posInBlock, bool update_tx) {
12181218
const CTransaction& tx = *ptx;
12191219

1220-
if (!AddToWalletIfInvolvingMe(ptx, pindex, posInBlock, true))
1220+
if (!AddToWalletIfInvolvingMe(ptx, pindex, posInBlock, update_tx))
12211221
return; // Not one of ours
12221222

12231223
// If a transaction changes 'conflicted' state, that changes the balance
@@ -1784,7 +1784,7 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, CBlock
17841784
break;
17851785
}
17861786
for (size_t posInBlock = 0; posInBlock < block.vtx.size(); ++posInBlock) {
1787-
AddToWalletIfInvolvingMe(block.vtx[posInBlock], pindex, posInBlock, fUpdate);
1787+
SyncTransaction(block.vtx[posInBlock], pindex, posInBlock, fUpdate);
17881788
}
17891789
} else {
17901790
ret = pindex;

src/wallet/wallet.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,9 @@ class CWallet final : public CCryptoKeyStore, public CValidationInterface
708708

709709
void SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator>);
710710

711-
/* Used by TransactionAddedToMemorypool/BlockConnected/Disconnected.
711+
/* Used by TransactionAddedToMemorypool/BlockConnected/Disconnected/ScanForWalletTransactions.
712712
* Should be called with pindexBlock and posInBlock if this is for a transaction that is included in a block. */
713-
void SyncTransaction(const CTransactionRef& tx, const CBlockIndex *pindex = nullptr, int posInBlock = 0) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
713+
void SyncTransaction(const CTransactionRef& tx, const CBlockIndex *pindex = nullptr, int posInBlock = 0, bool update_tx = true) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
714714

715715
/* the HD chain data model (external chain counters) */
716716
CHDChain hdChain;

0 commit comments

Comments
 (0)