diff options
author | glozow <gloriajzhao@gmail.com> | 2021-07-15 06:54:36 +0100 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2021-08-05 12:37:28 +0100 |
commit | 97dd1c729d2bbedf9527b914c0cc8267b8a7c21b (patch) | |
tree | d9629de3c92a5ca4f02dc6632a1d2875c69671a3 /src/txmempool.h | |
parent | f95bbf58aaf72aab8a9c5827b1f162f3b8ac38f4 (diff) |
MOVEONLY: add helper function for calculating ancestors and checking limits
Diffstat (limited to 'src/txmempool.h')
-rw-r--r-- | src/txmempool.h | 16 |
1 files changed, 16 insertions, 0 deletions
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<uint256> 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<COutPoint, const CTransaction*> mapNextTx GUARDED_BY(cs); std::map<uint256, CAmount> mapDeltas GUARDED_BY(cs); |