@@ -52,10 +52,10 @@ bool TxOrphanage::AddTx(const CTransactionRef& tx, NodeId peer)
52
52
53
53
int TxOrphanage::EraseTx (const Wtxid& wtxid)
54
54
{
55
- return EraseTxNoLock (wtxid);
55
+ return EraseTxInternal (wtxid);
56
56
}
57
57
58
- int TxOrphanage::EraseTxNoLock (const Wtxid& wtxid)
58
+ int TxOrphanage::EraseTxInternal (const Wtxid& wtxid)
59
59
{
60
60
std::map<Wtxid, OrphanTx>::iterator it = m_orphans.find (wtxid);
61
61
if (it == m_orphans.end ())
@@ -101,7 +101,7 @@ void TxOrphanage::EraseForPeer(NodeId peer)
101
101
// increment to avoid iterator becoming invalid after erasure
102
102
const auto & [wtxid, orphan] = *iter++;
103
103
if (orphan.fromPeer == peer) {
104
- nErased += EraseTxNoLock (wtxid);
104
+ nErased += EraseTxInternal (wtxid);
105
105
}
106
106
}
107
107
if (nErased > 0 ) LogPrint (BCLog::TXPACKAGES, " Erased %d orphan transaction(s) from peer=%d\n " , nErased, peer);
@@ -121,7 +121,7 @@ void TxOrphanage::LimitOrphans(unsigned int max_orphans, FastRandomContext& rng)
121
121
{
122
122
std::map<Wtxid, OrphanTx>::iterator maybeErase = iter++;
123
123
if (maybeErase->second .nTimeExpire <= nNow) {
124
- nErased += EraseTxNoLock (maybeErase->second .tx ->GetWitnessHash ());
124
+ nErased += EraseTxInternal (maybeErase->second .tx ->GetWitnessHash ());
125
125
} else {
126
126
nMinExpTime = std::min (maybeErase->second .nTimeExpire , nMinExpTime);
127
127
}
@@ -134,7 +134,7 @@ void TxOrphanage::LimitOrphans(unsigned int max_orphans, FastRandomContext& rng)
134
134
{
135
135
// Evict a random orphan:
136
136
size_t randompos = rng.randrange (m_orphan_list.size ());
137
- EraseTxNoLock (m_orphan_list[randompos]->second .tx ->GetWitnessHash ());
137
+ EraseTxInternal (m_orphan_list[randompos]->second .tx ->GetWitnessHash ());
138
138
++nEvicted;
139
139
}
140
140
if (nEvicted > 0 ) LogPrint (BCLog::TXPACKAGES, " orphanage overflow, removed %u tx\n " , nEvicted);
@@ -213,7 +213,7 @@ void TxOrphanage::EraseForBlock(const CBlock& block)
213
213
if (vOrphanErase.size ()) {
214
214
int nErased = 0 ;
215
215
for (const auto & orphanHash : vOrphanErase) {
216
- nErased += EraseTxNoLock (orphanHash);
216
+ nErased += EraseTxInternal (orphanHash);
217
217
}
218
218
LogPrint (BCLog::TXPACKAGES, " Erased %d orphan transaction(s) included or conflicted by block\n " , nErased);
219
219
}
0 commit comments