Check cluster limits when using -walletrejectlongchains

This commit is contained in:
Suhas Daftuar
2025-01-23 09:26:05 -05:00
parent 95762e6759
commit 95a8297d48
3 changed files with 17 additions and 3 deletions

View File

@@ -719,10 +719,11 @@ public:
util::Result<void> checkChainLimits(const CTransactionRef& tx) override
{
if (!m_node.mempool) return {};
LockPoints lp;
CTxMemPoolEntry entry(TxGraph::Ref(), tx, 0, 0, 0, 0, false, 0, lp);
if (!m_node.mempool->CheckPolicyLimits(tx)) {
return util::Error{Untranslated("too many unconfirmed transactions in cluster")};
}
LOCK(m_node.mempool->cs);
return m_node.mempool->CheckPackageLimits({tx}, entry.GetTxSize());
return m_node.mempool->CheckPackageLimits({tx}, GetVirtualTransactionSize(*tx));
}
CFeeRate estimateSmartFee(int num_blocks, bool conservative, FeeCalculation* calc) override
{