Changeset View
Changeset View
Standalone View
Standalone View
src/node/interfaces.cpp
Show First 20 Lines • Show All 617 Lines • ▼ Show 20 Lines | public: | ||||
/*wait_callback=*/false); | /*wait_callback=*/false); | ||||
// Chain clients only care about failures to accept the tx to the | // Chain clients only care about failures to accept the tx to the | ||||
// mempool. Disregard non-mempool related failures. Note: this will | // mempool. Disregard non-mempool related failures. Note: this will | ||||
// need to be updated if BroadcastTransactions() is updated to | // need to be updated if BroadcastTransactions() is updated to | ||||
// return other non-mempool failures that Chain clients do not need | // return other non-mempool failures that Chain clients do not need | ||||
// to know about. | // to know about. | ||||
return err == TransactionError::OK; | return err == TransactionError::OK; | ||||
} | } | ||||
void getTransactionAncestry(const TxId &txid, size_t &ancestors, | |||||
size_t &descendants, size_t *ancestorsize, | |||||
Amount *ancestorfees) override { | |||||
ancestors = descendants = 0; | |||||
// After wellington this stat will no longer exist | |||||
if (!m_node.mempool || m_node.mempool->wellingtonLatched) { | |||||
return; | |||||
} | |||||
m_node.mempool->GetTransactionAncestry(txid, ancestors, descendants, | |||||
ancestorsize, ancestorfees); | |||||
} | |||||
void getPackageLimits(size_t &limit_ancestor_count, | void getPackageLimits(size_t &limit_ancestor_count, | ||||
size_t &limit_descendant_count) override { | size_t &limit_descendant_count) override { | ||||
limit_ancestor_count = size_t( | limit_ancestor_count = size_t( | ||||
std::max<int64_t>(1, gArgs.GetIntArg("-limitancestorcount", | std::max<int64_t>(1, gArgs.GetIntArg("-limitancestorcount", | ||||
DEFAULT_ANCESTOR_LIMIT))); | DEFAULT_ANCESTOR_LIMIT))); | ||||
limit_descendant_count = size_t(std::max<int64_t>( | limit_descendant_count = size_t(std::max<int64_t>( | ||||
1, gArgs.GetIntArg("-limitdescendantcount", | 1, gArgs.GetIntArg("-limitdescendantcount", | ||||
DEFAULT_DESCENDANT_LIMIT))); | DEFAULT_DESCENDANT_LIMIT))); | ||||
} | } | ||||
bool checkChainLimits(const CTransactionRef &tx) override { | |||||
// After wellington this limitation will no longer exist | |||||
if (!m_node.mempool || m_node.mempool->wellingtonLatched) { | |||||
return true; | |||||
} | |||||
LockPoints lp; | |||||
CTxMemPoolEntry entry(tx, Amount(), 0, 0, false, 0, lp); | |||||
CTxMemPool::setEntries ancestors; | |||||
auto limit_ancestor_count = | |||||
gArgs.GetIntArg("-limitancestorcount", DEFAULT_ANCESTOR_LIMIT); | |||||
auto limit_ancestor_size = | |||||
gArgs.GetIntArg("-limitancestorsize", | |||||
DEFAULT_ANCESTOR_SIZE_LIMIT) * | |||||
1000; | |||||
auto limit_descendant_count = gArgs.GetIntArg( | |||||
"-limitdescendantcount", DEFAULT_DESCENDANT_LIMIT); | |||||
auto limit_descendant_size = | |||||
gArgs.GetIntArg("-limitdescendantsize", | |||||
DEFAULT_DESCENDANT_SIZE_LIMIT) * | |||||
1000; | |||||
std::string unused_error_string; | |||||
LOCK(m_node.mempool->cs); | |||||
return m_node.mempool->CalculateMemPoolAncestors( | |||||
entry, ancestors, limit_ancestor_count, limit_ancestor_size, | |||||
limit_descendant_count, limit_descendant_size, | |||||
unused_error_string); | |||||
} | |||||
CFeeRate estimateFee() const override { | CFeeRate estimateFee() const override { | ||||
if (!m_node.mempool) { | if (!m_node.mempool) { | ||||
return {}; | return {}; | ||||
} | } | ||||
return m_node.mempool->estimateFee(); | return m_node.mempool->estimateFee(); | ||||
} | } | ||||
CFeeRate relayMinFee() override { return ::minRelayTxFee; } | CFeeRate relayMinFee() override { return ::minRelayTxFee; } | ||||
CFeeRate relayDustFee() override { return ::dustRelayFee; } | CFeeRate relayDustFee() override { return ::dustRelayFee; } | ||||
▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines |