Avoid locking mutexes that are already held by the same thread
This commit is contained in:
parent
07ce278455
commit
01a06d6686
2 changed files with 2 additions and 2 deletions
|
@ -542,7 +542,7 @@ void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMem
|
||||||
void CTxMemPool::removeConflicts(const CTransaction &tx)
|
void CTxMemPool::removeConflicts(const CTransaction &tx)
|
||||||
{
|
{
|
||||||
// Remove transactions which depend on inputs of tx, recursively
|
// Remove transactions which depend on inputs of tx, recursively
|
||||||
LOCK(cs);
|
AssertLockHeld(cs);
|
||||||
for (const CTxIn &txin : tx.vin) {
|
for (const CTxIn &txin : tx.vin) {
|
||||||
auto it = mapNextTx.find(txin.prevout);
|
auto it = mapNextTx.find(txin.prevout);
|
||||||
if (it != mapNextTx.end()) {
|
if (it != mapNextTx.end()) {
|
||||||
|
|
|
@ -544,7 +544,7 @@ public:
|
||||||
|
|
||||||
void removeRecursive(const CTransaction &tx, MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN);
|
void removeRecursive(const CTransaction &tx, MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN);
|
||||||
void removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags);
|
void removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags);
|
||||||
void removeConflicts(const CTransaction &tx);
|
void removeConflicts(const CTransaction &tx) EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||||
void removeForBlock(const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight);
|
void removeForBlock(const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight);
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
|
Loading…
Add table
Reference in a new issue