Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 1,067 Lines • ▼ Show 20 Lines | for (const CTxIn &txin : wtx.tx->vin) { | ||||
CWalletTx &prevtx = it->second; | CWalletTx &prevtx = it->second; | ||||
if (prevtx.nIndex == -1 && !prevtx.hashUnset()) { | if (prevtx.nIndex == -1 && !prevtx.hashUnset()) { | ||||
MarkConflicted(prevtx.hashBlock, wtx.GetId()); | MarkConflicted(prevtx.hashBlock, wtx.GetId()); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
/** | |||||
* Add a transaction to the wallet, or update it. pIndex and posInBlock should | |||||
* be set when the transaction was known to be included in a block. When pIndex | |||||
* == nullptr, then wallet state is not updated in AddToWallet, but | |||||
* notifications happen and cached balances are marked dirty. | |||||
* | |||||
* If fUpdate is true, existing transactions will be updated. | |||||
* TODO: One exception to this is that the abandoned state is cleared under the | |||||
* assumption that any further notification of a transaction that was considered | |||||
* abandoned is an indication that it is not safe to be considered abandoned. | |||||
* Abandoned state should probably be more carefully tracked via different | |||||
* posInBlock signals or by checking mempool presence when necessary. | |||||
*/ | |||||
bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &ptx, | bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &ptx, | ||||
const CBlockIndex *pIndex, | const CBlockIndex *pIndex, | ||||
int posInBlock, bool fUpdate) { | int posInBlock, bool fUpdate) { | ||||
const CTransaction &tx = *ptx; | const CTransaction &tx = *ptx; | ||||
AssertLockHeld(cs_wallet); | AssertLockHeld(cs_wallet); | ||||
if (pIndex != nullptr) { | if (pIndex != nullptr) { | ||||
for (const CTxIn &txin : tx.vin) { | for (const CTxIn &txin : tx.vin) { | ||||
▲ Show 20 Lines • Show All 3,810 Lines • Show Last 20 Lines |