mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
refactor: Avoid locking tx pool cs thrice
This commit is contained in:
@@ -151,8 +151,6 @@ void CTxMemPool::UpdateTransactionsFromBlock(const std::vector<uint256> &vHashes
|
||||
|
||||
bool CTxMemPool::CalculateMemPoolAncestors(const CTxMemPoolEntry &entry, setEntries &setAncestors, uint64_t limitAncestorCount, uint64_t limitAncestorSize, uint64_t limitDescendantCount, uint64_t limitDescendantSize, std::string &errString, bool fSearchForParents /* = true */) const
|
||||
{
|
||||
LOCK(cs);
|
||||
|
||||
setEntries parentHashes;
|
||||
const CTransaction &tx = entry.GetTx();
|
||||
|
||||
@@ -363,7 +361,6 @@ void CTxMemPool::addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry,
|
||||
// Add to memory pool without checking anything.
|
||||
// Used by AcceptToMemoryPool(), which DOES do
|
||||
// all the appropriate checks.
|
||||
LOCK(cs);
|
||||
indexed_transaction_set::iterator newit = mapTx.insert(entry).first;
|
||||
mapLinks.insert(make_pair(newit, TxLinks()));
|
||||
|
||||
@@ -933,7 +930,6 @@ int CTxMemPool::Expire(int64_t time) {
|
||||
|
||||
void CTxMemPool::addUnchecked(const uint256&hash, const CTxMemPoolEntry &entry, bool validFeeEstimate)
|
||||
{
|
||||
LOCK(cs);
|
||||
setEntries setAncestors;
|
||||
uint64_t nNoLimit = std::numeric_limits<uint64_t>::max();
|
||||
std::string dummy;
|
||||
|
||||
Reference in New Issue
Block a user