mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-27 09:21:43 +02:00
doc: Fix CWalletTx::Confirmation doc
Follow-up to: * commit 700c42b85d20e624bef4228eef062c93084efab5, which replaced pIndex with block_hash in AddToWalletIfInvolvingMe. * commit 9700fcb47feca9d78e005b8d18b41148c8f6b25f, which replaced posInBlock with confirm.nIndex.
This commit is contained in:
parent
88fc7950f8
commit
fa8fef6ef2
@ -162,7 +162,8 @@ public:
|
|||||||
int block_height;
|
int block_height;
|
||||||
uint256 hashBlock;
|
uint256 hashBlock;
|
||||||
int nIndex;
|
int nIndex;
|
||||||
Confirmation(Status s = UNCONFIRMED, int b = 0, uint256 h = uint256(), int i = 0) : status(s), block_height(b), hashBlock(h), nIndex(i) {}
|
Confirmation(Status status = UNCONFIRMED, int block_height = 0, uint256 block_hash = uint256(), int block_index = 0)
|
||||||
|
: status{status}, block_height{block_height}, hashBlock{block_hash}, nIndex{block_index} {}
|
||||||
};
|
};
|
||||||
|
|
||||||
Confirmation m_confirm;
|
Confirmation m_confirm;
|
||||||
|
@ -1212,7 +1212,7 @@ void CWallet::SyncTransaction(const CTransactionRef& ptx, CWalletTx::Confirmatio
|
|||||||
|
|
||||||
void CWallet::transactionAddedToMempool(const CTransactionRef& tx, uint64_t mempool_sequence) {
|
void CWallet::transactionAddedToMempool(const CTransactionRef& tx, uint64_t mempool_sequence) {
|
||||||
LOCK(cs_wallet);
|
LOCK(cs_wallet);
|
||||||
SyncTransaction(tx, {CWalletTx::Status::UNCONFIRMED, /* block height */ 0, /* block hash */ {}, /* index */ 0});
|
SyncTransaction(tx, {CWalletTx::Status::UNCONFIRMED, /*block_height=*/0, /*block_hash=*/{}, /*block_index=*/0});
|
||||||
|
|
||||||
auto it = mapWallet.find(tx->GetHash());
|
auto it = mapWallet.find(tx->GetHash());
|
||||||
if (it != mapWallet.end()) {
|
if (it != mapWallet.end()) {
|
||||||
@ -1253,7 +1253,7 @@ void CWallet::transactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRe
|
|||||||
// distinguishing between conflicted and unconfirmed transactions are
|
// distinguishing between conflicted and unconfirmed transactions are
|
||||||
// imperfect, and could be improved in general, see
|
// imperfect, and could be improved in general, see
|
||||||
// https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Wallet-Transaction-Conflict-Tracking
|
// https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Wallet-Transaction-Conflict-Tracking
|
||||||
SyncTransaction(tx, {CWalletTx::Status::UNCONFIRMED, /* block height */ 0, /* block hash */ {}, /* index */ 0});
|
SyncTransaction(tx, {CWalletTx::Status::UNCONFIRMED, /*block_height=*/0, /*block_hash=*/{}, /*block_index=*/0});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1281,7 +1281,7 @@ void CWallet::blockDisconnected(const CBlock& block, int height)
|
|||||||
m_last_block_processed_height = height - 1;
|
m_last_block_processed_height = height - 1;
|
||||||
m_last_block_processed = block.hashPrevBlock;
|
m_last_block_processed = block.hashPrevBlock;
|
||||||
for (const CTransactionRef& ptx : block.vtx) {
|
for (const CTransactionRef& ptx : block.vtx) {
|
||||||
SyncTransaction(ptx, {CWalletTx::Status::UNCONFIRMED, /* block height */ 0, /* block hash */ {}, /* index */ 0});
|
SyncTransaction(ptx, {CWalletTx::Status::UNCONFIRMED, /*block_height=*/0, /*block_hash=*/{}, /*block_index=*/0});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,9 +260,9 @@ private:
|
|||||||
void AddToSpends(const uint256& wtxid, WalletBatch* batch = nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
void AddToSpends(const uint256& wtxid, WalletBatch* batch = nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a transaction to the wallet, or update it. pIndex and posInBlock should
|
* Add a transaction to the wallet, or update it. confirm.block_* should
|
||||||
* be set when the transaction was known to be included in a block. When
|
* 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
|
* block_hash.IsNull(), then wallet state is not updated in AddToWallet, but
|
||||||
* notifications happen and cached balances are marked dirty.
|
* notifications happen and cached balances are marked dirty.
|
||||||
*
|
*
|
||||||
* If fUpdate is true, existing transactions will be updated.
|
* If fUpdate is true, existing transactions will be updated.
|
||||||
@ -270,7 +270,7 @@ private:
|
|||||||
* assumption that any further notification of a transaction that was considered
|
* 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 is an indication that it is not safe to be considered abandoned.
|
||||||
* Abandoned state should probably be more carefully tracked via different
|
* Abandoned state should probably be more carefully tracked via different
|
||||||
* posInBlock signals or by checking mempool presence when necessary.
|
* chain notifications or by checking mempool presence when necessary.
|
||||||
*
|
*
|
||||||
* Should be called with rescanning_old_block set to true, if the transaction is
|
* Should be called with rescanning_old_block set to true, if the transaction is
|
||||||
* not discovered in real time, but during a rescan of old blocks.
|
* not discovered in real time, but during a rescan of old blocks.
|
||||||
@ -285,8 +285,6 @@ private:
|
|||||||
|
|
||||||
void SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator>) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
void SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator>) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
||||||
|
|
||||||
/* Used by TransactionAddedToMemorypool/BlockConnected/Disconnected/ScanForWalletTransactions.
|
|
||||||
* Should be called with non-zero block_hash and posInBlock if this is for a transaction that is included in a block. */
|
|
||||||
void SyncTransaction(const CTransactionRef& tx, CWalletTx::Confirmation confirm, bool update_tx = true, bool rescanning_old_block = false) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
void SyncTransaction(const CTransactionRef& tx, CWalletTx::Confirmation confirm, bool update_tx = true, bool rescanning_old_block = false) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
||||||
|
|
||||||
/** WalletFlags set on this wallet. */
|
/** WalletFlags set on this wallet. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user