aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.cpp
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2023-01-04 08:44:21 +0000
committerglozow <gloriajzhao@gmail.com>2023-01-04 08:44:26 +0000
commit03254c22296a8a05f42c7faea8dde1db7be06459 (patch)
treebb1e90f2fd9516ab738664619d6ab31d4bac8865 /src/txmempool.cpp
parent3f8591d46b46cec2c4effc01f8822222087d74c4 (diff)
parentfa818e103c0ddb515f29ae9ce8de44931e12e69e (diff)
downloadbitcoin-03254c22296a8a05f42c7faea8dde1db7be06459.tar.xz
Merge bitcoin/bitcoin#19909: refactor: Remove unused CTxMemPool::clear() helper
fa818e103c0ddb515f29ae9ce8de44931e12e69e txmempool: Remove unused clear() member function (MarcoFalke) Pull request description: Seems odd to have code in Bitcoin Core that is unused. Moreover the function was broken (see https://github.com/bitcoin/bitcoin/pull/24145) and is brittle, as there is nothing that prevents similar bugs from re-appearing. Fix both issues by replacing it with C++11 member initializers. ACKs for top commit: glozow: ACK fa818e103c0ddb515f29ae9ce8de44931e12e69e Tree-SHA512: e79e44cac7d5a84d9ecc8e3f3b0b9a50e1e3ebec358b20ba5dac175ef07d1fbe338a20f83ee80f746f7c726c79e77f8be49e14bca57a41063da8a5302123c3a9
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r--src/txmempool.cpp21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index 50cd34dde4..c2a8ed0e27 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -396,7 +396,6 @@ CTxMemPool::CTxMemPool(const Options& opts)
m_full_rbf{opts.full_rbf},
m_limits{opts.limits}
{
- _clear(); //lock free clear
}
bool CTxMemPool::isSpent(const COutPoint& outpoint) const
@@ -634,26 +633,6 @@ void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigne
blockSinceLastRollingFeeBump = true;
}
-void CTxMemPool::_clear()
-{
- vTxHashes.clear();
- mapTx.clear();
- mapNextTx.clear();
- totalTxSize = 0;
- m_total_fee = 0;
- cachedInnerUsage = 0;
- lastRollingFeeUpdate = GetTime();
- blockSinceLastRollingFeeBump = false;
- rollingMinimumFeeRate = 0;
- ++nTransactionsUpdated;
-}
-
-void CTxMemPool::clear()
-{
- LOCK(cs);
- _clear();
-}
-
void CTxMemPool::check(const CCoinsViewCache& active_coins_tip, int64_t spendheight) const
{
if (m_check_ratio == 0) return;