Merge bitcoin/bitcoin#29086: refactor: Simply include CTxMemPool::Options in CTxMemPool directly rather than duplicating definition

cc67d33fda refactor: Simply include CTxMemPool::Options in CTxMemPool directly rather than duplicating definition (Luke Dashjr)

Pull request description:

  Instead of duplicating mempool options two places, just include the Options struct directly on the CTxMemPool

ACKs for top commit:
  achow101:
    ACK cc67d33fda
  kristapsk:
    cr utACK cc67d33fda
  jonatack:
    ACK cc67d33fda

Tree-SHA512: 9deb5ea6f85eeb1c7e04536cded65303b0ec459936a97e4f257aff2c50b0984a4ddbf69a4651f48455b9c80200a1fd24e9c74926874fdd9be436bbbe406251ce
This commit is contained in:
Ava Chow
2024-05-14 20:00:34 -04:00
11 changed files with 66 additions and 92 deletions

View File

@@ -318,7 +318,7 @@ public:
CFeeRate getDustRelayFee() override
{
if (!m_context->mempool) return CFeeRate{DUST_RELAY_TX_FEE};
return m_context->mempool->m_dust_relay_feerate;
return m_context->mempool->m_opts.dust_relay_feerate;
}
UniValue executeRpc(const std::string& command, const UniValue& params, const std::string& uri) override
{
@@ -701,7 +701,7 @@ public:
{
const CTxMemPool::Limits default_limits{};
const CTxMemPool::Limits& limits{m_node.mempool ? m_node.mempool->m_limits : default_limits};
const CTxMemPool::Limits& limits{m_node.mempool ? m_node.mempool->m_opts.limits : default_limits};
limit_ancestor_count = limits.ancestor_count;
limit_descendant_count = limits.descendant_count;
@@ -732,17 +732,17 @@ public:
CFeeRate relayMinFee() override
{
if (!m_node.mempool) return CFeeRate{DEFAULT_MIN_RELAY_TX_FEE};
return m_node.mempool->m_min_relay_feerate;
return m_node.mempool->m_opts.min_relay_feerate;
}
CFeeRate relayIncrementalFee() override
{
if (!m_node.mempool) return CFeeRate{DEFAULT_INCREMENTAL_RELAY_FEE};
return m_node.mempool->m_incremental_relay_feerate;
return m_node.mempool->m_opts.incremental_relay_feerate;
}
CFeeRate relayDustFee() override
{
if (!m_node.mempool) return CFeeRate{DUST_RELAY_TX_FEE};
return m_node.mempool->m_dust_relay_feerate;
return m_node.mempool->m_opts.dust_relay_feerate;
}
bool havePruned() override
{