diff options
author | Alex Morcos <morcos@chaincode.com> | 2016-12-16 14:17:13 -0500 |
---|---|---|
committer | Alex Morcos <morcos@chaincode.com> | 2017-01-23 15:43:22 -0500 |
commit | 094e4b33839404d9c18200fc30d9a993a3dc106f (patch) | |
tree | 7a85d9479cb849c407a7b7c4a4d4aaf0e607cea7 /src/wallet/wallet.cpp | |
parent | 4afbde6028708541c4da8732a1bd12fb8735fdae (diff) | |
download | bitcoin-094e4b33839404d9c18200fc30d9a993a3dc106f.tar.xz |
Better document usage of SyncTransaction
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r-- | src/wallet/wallet.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 358a5ecfc1..b4715622cf 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1003,9 +1003,17 @@ bool CWallet::LoadToWallet(const CWalletTx& wtxIn) } /** - * Add a transaction to the wallet, or update it. - * pblock is optional, but should be provided if the transaction is known to be in a block. + * 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 + * posInBlock = SYNC_TRANSACTION_NOT_IN_BLOCK (-1) , 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 carefuly tracked via different + * posInBlock signals or by checking mempool presence when necessary. */ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlockIndex* pIndex, int posInBlock, bool fUpdate) { |