Skip to content

Commit fd92b0c

Browse files
committed
document workspace members
1 parent 3d3e459 commit fd92b0c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/validation.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,24 +497,37 @@ class MemPoolAccept
497497
// of checking a given transaction.
498498
struct Workspace {
499499
explicit Workspace(const CTransactionRef& ptx) : m_ptx(ptx), m_hash(ptx->GetHash()) {}
500+
/** Txids of mempool transactions that this transaction directly conflicts with. */
500501
std::set<uint256> m_conflicts;
502+
/** Iterators to mempool entries that this transaction directly conflicts with. */
501503
CTxMemPool::setEntries m_iters_conflicting;
504+
/** Iterators to all mempool entries that would be replaced by this transaction, including
505+
* those it directly conflicts with and their descendants. */
502506
CTxMemPool::setEntries m_all_conflicting;
507+
/** All mempool ancestors of this transaction. */
503508
CTxMemPool::setEntries m_ancestors;
509+
/** Mempool entry constructed for this transaction. Constructed in PreChecks() but not
510+
* inserted into the mempool until Finalize(). */
504511
std::unique_ptr<CTxMemPoolEntry> m_entry;
512+
/** Pointers to the transactions that have been removed from the mempool and replaced by
513+
* this transaction, used to return to the MemPoolAccept caller. Only populated if
514+
* validation is successful and the original transactions are removed. */
505515
std::list<CTransactionRef> m_replaced_transactions;
506516

507517
/** Virtual size of the transaction as used by the mempool, calculated using serialized size
508518
* of the transaction and sigops. */
509519
int64_t m_vsize;
520+
/** Fees paid by this transaction: total input amounts subtracted by total output amounts. */
510521
CAmount m_base_fees;
522+
/** Base fees + any fee delta set by the user with prioritisetransaction. */
511523
CAmount m_modified_fees;
512524
/** Total modified fees of all transactions being replaced. */
513525
CAmount m_conflicting_fees{0};
514526
/** Total virtual size of all transactions being replaced. */
515527
size_t m_conflicting_size{0};
516528

517529
const CTransactionRef& m_ptx;
530+
/** Txid. */
518531
const uint256& m_hash;
519532
TxValidationState m_state;
520533
/** A temporary cache containing serialized transaction data for signature verification.

0 commit comments

Comments
 (0)