From 97dd1c729d2bbedf9527b914c0cc8267b8a7c21b Mon Sep 17 00:00:00 2001 From: glozow Date: Thu, 15 Jul 2021 06:54:36 +0100 Subject: MOVEONLY: add helper function for calculating ancestors and checking limits --- src/txmempool.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/txmempool.h') diff --git a/src/txmempool.h b/src/txmempool.h index ae4b16d377..76ca83c25c 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -585,6 +585,22 @@ private: */ std::set m_unbroadcast_txids GUARDED_BY(cs); + + /** + * 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. + */ + bool CalculateAncestorsAndCheckLimits(const CTxMemPoolEntry& entry, + setEntries& setAncestors, + CTxMemPoolEntry::Parents &staged_ancestors, + uint64_t limitAncestorCount, + uint64_t limitAncestorSize, + uint64_t limitDescendantCount, + uint64_t limitDescendantSize, + std::string &errString) const EXCLUSIVE_LOCKS_REQUIRED(cs); + public: indirectmap mapNextTx GUARDED_BY(cs); std::map mapDeltas GUARDED_BY(cs); -- cgit v1.2.3