Skip to content

Commit 7c3fb97

Browse files
committed
scripted-diff: rename TxOrphanage::EraseTxNoLock to EraseTxInternal
The lock doesn't exist anymore. -BEGIN VERIFY SCRIPT- sed -i 's/EraseTxNoLock/EraseTxInternal/g' src/txorphanage.* -END VERIFY SCRIPT-))'
1 parent 879f5db commit 7c3fb97

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/txorphanage.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ bool TxOrphanage::AddTx(const CTransactionRef& tx, NodeId peer)
5252

5353
int TxOrphanage::EraseTx(const Wtxid& wtxid)
5454
{
55-
return EraseTxNoLock(wtxid);
55+
return EraseTxInternal(wtxid);
5656
}
5757

58-
int TxOrphanage::EraseTxNoLock(const Wtxid& wtxid)
58+
int TxOrphanage::EraseTxInternal(const Wtxid& wtxid)
5959
{
6060
std::map<Wtxid, OrphanTx>::iterator it = m_orphans.find(wtxid);
6161
if (it == m_orphans.end())
@@ -101,7 +101,7 @@ void TxOrphanage::EraseForPeer(NodeId peer)
101101
// increment to avoid iterator becoming invalid after erasure
102102
const auto& [wtxid, orphan] = *iter++;
103103
if (orphan.fromPeer == peer) {
104-
nErased += EraseTxNoLock(wtxid);
104+
nErased += EraseTxInternal(wtxid);
105105
}
106106
}
107107
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)
121121
{
122122
std::map<Wtxid, OrphanTx>::iterator maybeErase = iter++;
123123
if (maybeErase->second.nTimeExpire <= nNow) {
124-
nErased += EraseTxNoLock(maybeErase->second.tx->GetWitnessHash());
124+
nErased += EraseTxInternal(maybeErase->second.tx->GetWitnessHash());
125125
} else {
126126
nMinExpTime = std::min(maybeErase->second.nTimeExpire, nMinExpTime);
127127
}
@@ -134,7 +134,7 @@ void TxOrphanage::LimitOrphans(unsigned int max_orphans, FastRandomContext& rng)
134134
{
135135
// Evict a random orphan:
136136
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());
138138
++nEvicted;
139139
}
140140
if (nEvicted > 0) LogPrint(BCLog::TXPACKAGES, "orphanage overflow, removed %u tx\n", nEvicted);
@@ -213,7 +213,7 @@ void TxOrphanage::EraseForBlock(const CBlock& block)
213213
if (vOrphanErase.size()) {
214214
int nErased = 0;
215215
for (const auto& orphanHash : vOrphanErase) {
216-
nErased += EraseTxNoLock(orphanHash);
216+
nErased += EraseTxInternal(orphanHash);
217217
}
218218
LogPrint(BCLog::TXPACKAGES, "Erased %d orphan transaction(s) included or conflicted by block\n", nErased);
219219
}

src/txorphanage.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class TxOrphanage {
9999
std::vector<OrphanMap::iterator> m_orphan_list;
100100

101101
/** Erase an orphan by wtxid */
102-
int EraseTxNoLock(const Wtxid& wtxid);
102+
int EraseTxInternal(const Wtxid& wtxid);
103103
};
104104

105105
#endif // BITCOIN_TXORPHANAGE_H

0 commit comments

Comments
 (0)