aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.h
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2021-07-15 07:09:22 +0100
committerglozow <gloriajzhao@gmail.com>2021-08-05 12:37:28 +0100
commitf551841d3ec080a2d7a7988c7b35088dff6c5830 (patch)
treefa79ebcd5d58be4c5cc7bfbfb05864d6c61c753a /src/txmempool.h
parent97dd1c729d2bbedf9527b914c0cc8267b8a7c21b (diff)
[refactor] pass size/count instead of entry to CalculateAncestorsAndCheckLimits
This does not change existing behavior. The ancestor/descendant limits are inclusive of the entries themselves, but CalculateAncestorsAndCheckLimits() does not need access to them.
Diffstat (limited to 'src/txmempool.h')
-rw-r--r--src/txmempool.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/txmempool.h b/src/txmempool.h
index 76ca83c25c..71345ffb5d 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -587,12 +587,15 @@ private:
/**
- * Helper function to populate setAncestors with all the ancestors of entry and apply ancestor
- * and descendant limits.
- * param@[out] setAncestors Will be populated with all mempool ancestors of entry.
- * param@[in] staged_ancestors Should contain mempool parents of entry.
+ * Helper function to calculate all in-mempool ancestors of staged_ancestors and apply ancestor
+ * and descendant limits (including staged_ancestors thsemselves, entry_size and entry_count).
+ * param@[in] entry_size Virtual size to include in the limits.
+ * param@[in] entry_count How many entries to include in the limits.
+ * param@[in] staged_ancestors Should contain entries in the mempool.
+ * param@[out] setAncestors Will be populated with all mempool ancestors.
*/
- bool CalculateAncestorsAndCheckLimits(const CTxMemPoolEntry& entry,
+ bool CalculateAncestorsAndCheckLimits(size_t entry_size,
+ size_t entry_count,
setEntries& setAncestors,
CTxMemPoolEntry::Parents &staged_ancestors,
uint64_t limitAncestorCount,