Skip to content

Commit a4ec07f

Browse files
committed
doc: add comments for CTxMemPool::ChangeSet
1 parent 83f814b commit a4ec07f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/txmempool.h

+28
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,34 @@ class CTxMemPool
791791
return !it || visited(*it);
792792
}
793793

794+
/*
795+
* CTxMemPool::ChangeSet:
796+
*
797+
* This class is used for all mempool additions and associated removals (eg
798+
* due to rbf). Removals that don't need to be evaluated for acceptance,
799+
* such as removing transactions that appear in a block, or due to reorg,
800+
* or removals related to mempool limiting or expiry do not need to use
801+
* this.
802+
*
803+
* Callers can interleave calls to StageAddition()/StageRemoval(), and
804+
* removals may be invoked in any order, but additions must be done in a
805+
* topological order in the case of transaction packages (ie, parents must
806+
* be added before children).
807+
*
808+
* CalculateChunksForRBF() can be used to calculate the feerate diagram of
809+
* the proposed set of new transactions and compare with the existing
810+
* mempool.
811+
*
812+
* CalculateMemPoolAncestors() calculates the in-mempool (not including
813+
* what is in the change set itself) ancestors of a given transacion.
814+
*
815+
* Apply() will apply the removals and additions that are staged into the
816+
* mempool.
817+
*
818+
* Only one changeset may exist at a time. While a changeset is
819+
* outstanding, no removals or additions may be made directly to the
820+
* mempool.
821+
*/
794822
class ChangeSet {
795823
public:
796824
explicit ChangeSet(CTxMemPool* pool) : m_pool(pool) {}

0 commit comments

Comments
 (0)