@@ -59,10 +59,10 @@ bool TxOrphanage::AddTx(const CTransactionRef& tx, NodeId peer)
5959int TxOrphanage::EraseTx (const uint256& txid)
6060{
6161 LOCK (m_mutex);
62- return _EraseTx (txid);
62+ return EraseTxNoLock (txid);
6363}
6464
65- int TxOrphanage::_EraseTx (const uint256& txid)
65+ int TxOrphanage::EraseTxNoLock (const uint256& txid)
6666{
6767 AssertLockHeld (m_mutex);
6868 std::map<uint256, OrphanTx>::iterator it = m_orphans.find (txid);
@@ -110,7 +110,7 @@ void TxOrphanage::EraseForPeer(NodeId peer)
110110 std::map<uint256, OrphanTx>::iterator maybeErase = iter++; // increment to avoid iterator becoming invalid
111111 if (maybeErase->second .fromPeer == peer)
112112 {
113- nErased += _EraseTx (maybeErase->second .tx ->GetHash ());
113+ nErased += EraseTxNoLock (maybeErase->second .tx ->GetHash ());
114114 }
115115 }
116116 if (nErased > 0 ) LogPrint (BCLog::MEMPOOL , " Erased %d orphan tx from peer=%d\n " , nErased, peer);
@@ -132,7 +132,7 @@ void TxOrphanage::LimitOrphans(unsigned int max_orphans_size)
132132 {
133133 std::map<uint256, OrphanTx>::iterator maybeErase = iter++;
134134 if (maybeErase->second .nTimeExpire <= nNow) {
135- nErased += _EraseTx (maybeErase->second .tx ->GetHash ());
135+ nErased += EraseTxNoLock (maybeErase->second .tx ->GetHash ());
136136 } else {
137137 nMinExpTime = std::min (maybeErase->second .nTimeExpire , nMinExpTime);
138138 }
@@ -146,7 +146,7 @@ void TxOrphanage::LimitOrphans(unsigned int max_orphans_size)
146146 {
147147 // Evict a random orphan:
148148 size_t randompos = rng.randrange (m_orphan_list.size ());
149- _EraseTx (m_orphan_list[randompos]->first );
149+ EraseTxNoLock (m_orphan_list[randompos]->first );
150150 ++nEvicted;
151151 }
152152 if (nEvicted > 0 ) LogPrint (BCLog::MEMPOOL , " orphanage overflow, removed %u tx\n " , nEvicted);
@@ -234,7 +234,7 @@ void TxOrphanage::EraseForBlock(const CBlock& block)
234234 if (vOrphanErase.size ()) {
235235 int nErased = 0 ;
236236 for (const uint256& orphanHash : vOrphanErase) {
237- nErased += _EraseTx (orphanHash);
237+ nErased += EraseTxNoLock (orphanHash);
238238 }
239239 LogPrint (BCLog::MEMPOOL , " Erased %d orphan tx included or conflicted by block\n " , nErased);
240240 }
0 commit comments