@@ -653,24 +653,25 @@ class ChainImpl : public Chain
653
653
}
654
654
void getPackageLimits (unsigned int & limit_ancestor_count, unsigned int & limit_descendant_count) override
655
655
{
656
- limit_ancestor_count = gArgs .GetIntArg (" -limitancestorcount" , DEFAULT_ANCESTOR_LIMIT);
657
- limit_descendant_count = gArgs .GetIntArg (" -limitdescendantcount" , DEFAULT_DESCENDANT_LIMIT);
656
+ const CTxMemPool::Limits default_limits{};
657
+
658
+ const CTxMemPool::Limits& limits{m_node.mempool ? m_node.mempool ->m_limits : default_limits};
659
+
660
+ limit_ancestor_count = limits.ancestor_count ;
661
+ limit_descendant_count = limits.descendant_count ;
658
662
}
659
663
bool checkChainLimits (const CTransactionRef& tx) override
660
664
{
661
665
if (!m_node.mempool ) return true ;
662
666
LockPoints lp;
663
667
CTxMemPoolEntry entry (tx, 0 , 0 , 0 , false , 0 , lp);
664
668
CTxMemPool::setEntries ancestors;
665
- auto limit_ancestor_count = gArgs .GetIntArg (" -limitancestorcount" , DEFAULT_ANCESTOR_LIMIT);
666
- auto limit_ancestor_size = gArgs .GetIntArg (" -limitancestorsize" , DEFAULT_ANCESTOR_SIZE_LIMIT_KVB) * 1000 ;
667
- auto limit_descendant_count = gArgs .GetIntArg (" -limitdescendantcount" , DEFAULT_DESCENDANT_LIMIT);
668
- auto limit_descendant_size = gArgs .GetIntArg (" -limitdescendantsize" , DEFAULT_DESCENDANT_SIZE_LIMIT_KVB) * 1000 ;
669
+ const CTxMemPool::Limits& limits{m_node.mempool ->m_limits };
669
670
std::string unused_error_string;
670
671
LOCK (m_node.mempool ->cs );
671
672
return m_node.mempool ->CalculateMemPoolAncestors (
672
- entry, ancestors, limit_ancestor_count, limit_ancestor_size ,
673
- limit_descendant_count, limit_descendant_size , unused_error_string);
673
+ entry, ancestors, limits. ancestor_count , limits. ancestor_size_vbytes ,
674
+ limits. descendant_count , limits. descendant_size_vbytes , unused_error_string);
674
675
}
675
676
CFeeRate estimateSmartFee (int num_blocks, bool conservative, FeeCalculation* calc) override
676
677
{
0 commit comments