Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 733 Lines • ▼ Show 20 Lines | private: | ||||
* (double-spends or mutated transactions where the mutant gets mined). | * (double-spends or mutated transactions where the mutant gets mined). | ||||
*/ | */ | ||||
typedef std::multimap<COutPoint, TxId> TxSpends; | typedef std::multimap<COutPoint, TxId> TxSpends; | ||||
TxSpends mapTxSpends; | TxSpends mapTxSpends; | ||||
void AddToSpends(const COutPoint &outpoint, const TxId &wtxid); | void AddToSpends(const COutPoint &outpoint, const TxId &wtxid); | ||||
void AddToSpends(const TxId &wtxid); | void AddToSpends(const TxId &wtxid); | ||||
/** | /** | ||||
* 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 AddToWalletIfInvolvingMe(const CTransactionRef &tx, | |||||
const CBlockIndex *pIndex, int posInBlock, | |||||
bool fUpdate) | |||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | |||||
/** | |||||
* Mark a transaction (and its in-wallet descendants) as conflicting with a | * Mark a transaction (and its in-wallet descendants) as conflicting with a | ||||
* particular block. | * particular block. | ||||
*/ | */ | ||||
void MarkConflicted(const BlockHash &hashBlock, const TxId &txid); | void MarkConflicted(const BlockHash &hashBlock, const TxId &txid); | ||||
/** | /** | ||||
* Mark a transaction's inputs dirty, thus forcing the outputs to be | * Mark a transaction's inputs dirty, thus forcing the outputs to be | ||||
* recomputed | * recomputed | ||||
▲ Show 20 Lines • Show All 304 Lines • ▼ Show 20 Lines | public: | ||||
void LoadToWallet(const CWalletTx &wtxIn); | void LoadToWallet(const CWalletTx &wtxIn); | ||||
void TransactionAddedToMempool(const CTransactionRef &tx) override; | void TransactionAddedToMempool(const CTransactionRef &tx) override; | ||||
void | void | ||||
BlockConnected(const std::shared_ptr<const CBlock> &pblock, | BlockConnected(const std::shared_ptr<const CBlock> &pblock, | ||||
const CBlockIndex *pindex, | const CBlockIndex *pindex, | ||||
const std::vector<CTransactionRef> &vtxConflicted) override; | const std::vector<CTransactionRef> &vtxConflicted) override; | ||||
void | void | ||||
BlockDisconnected(const std::shared_ptr<const CBlock> &pblock) override; | BlockDisconnected(const std::shared_ptr<const CBlock> &pblock) override; | ||||
bool AddToWalletIfInvolvingMe(const CTransactionRef &tx, | |||||
const CBlockIndex *pIndex, int posInBlock, | |||||
bool fUpdate) | |||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | |||||
int64_t RescanFromTime(int64_t startTime, | int64_t RescanFromTime(int64_t startTime, | ||||
const WalletRescanReserver &reserver, bool update); | const WalletRescanReserver &reserver, bool update); | ||||
CBlockIndex *ScanForWalletTransactions(CBlockIndex *pindexStart, | CBlockIndex *ScanForWalletTransactions(CBlockIndex *pindexStart, | ||||
CBlockIndex *pindexStop, | CBlockIndex *pindexStop, | ||||
const WalletRescanReserver &reserver, | const WalletRescanReserver &reserver, | ||||
bool fUpdate = false); | bool fUpdate = false); | ||||
void TransactionRemovedFromMempool(const CTransactionRef &ptx) override; | void TransactionRemovedFromMempool(const CTransactionRef &ptx) override; | ||||
void ReacceptWalletTransactions(); | void ReacceptWalletTransactions(); | ||||
▲ Show 20 Lines • Show All 417 Lines • Show Last 20 Lines |