mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Track transaction packages in CTxMemPoolEntry
Associate with each CTxMemPoolEntry all the size/fees of descendant mempool transactions. Sort mempool by max(feerate of entry, feerate of descendants). Update statistics on-the-fly as transactions enter or leave the mempool. Also add ancestor and descendant limiting, so that transactions can be rejected if the number or size of unconfirmed ancestors exceeds a target, or if adding a transaction would cause some other mempool entry to have too many (or too large) a set of unconfirmed in- mempool descendants.
This commit is contained in:
committed by
Suhas Daftuar
parent
34628a1807
commit
5add7a74a6
@@ -74,18 +74,30 @@ static inline size_t DynamicUsage(const std::vector<X>& v)
|
||||
return MallocUsage(v.capacity() * sizeof(X));
|
||||
}
|
||||
|
||||
template<typename X>
|
||||
static inline size_t DynamicUsage(const std::set<X>& s)
|
||||
template<typename X, typename Y>
|
||||
static inline size_t DynamicUsage(const std::set<X, Y>& s)
|
||||
{
|
||||
return MallocUsage(sizeof(stl_tree_node<X>)) * s.size();
|
||||
}
|
||||
|
||||
template<typename X, typename Y>
|
||||
static inline size_t DynamicUsage(const std::map<X, Y>& m)
|
||||
static inline size_t IncrementalDynamicUsage(const std::set<X, Y>& s)
|
||||
{
|
||||
return MallocUsage(sizeof(stl_tree_node<X>));
|
||||
}
|
||||
|
||||
template<typename X, typename Y, typename Z>
|
||||
static inline size_t DynamicUsage(const std::map<X, Y, Z>& m)
|
||||
{
|
||||
return MallocUsage(sizeof(stl_tree_node<std::pair<const X, Y> >)) * m.size();
|
||||
}
|
||||
|
||||
template<typename X, typename Y, typename Z>
|
||||
static inline size_t IncrementalDynamicUsage(const std::map<X, Y, Z>& m)
|
||||
{
|
||||
return MallocUsage(sizeof(stl_tree_node<std::pair<const X, Y> >));
|
||||
}
|
||||
|
||||
// Boost data structures
|
||||
|
||||
template<typename X>
|
||||
|
||||
Reference in New Issue
Block a user