Skip to content

Commit 6e4d392

Browse files
committed
[refactor] rename to OrphanResolutionCandidate to MaybeAdd*
1 parent 57221ad commit 6e4d392

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/node/txdownloadman_impl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ bool TxDownloadManagerImpl::AddTxAnnouncement(NodeId peer, const GenTxid& gtxid,
187187

188188
if (unique_parents.empty()) return true;
189189

190-
if (OrphanResolutionCandidate(unique_parents, orphan_tx->GetWitnessHash(), peer, now)) {
190+
if (MaybeAddOrphanResolutionCandidate(unique_parents, orphan_tx->GetWitnessHash(), peer, now)) {
191191
m_orphanage.AddAnnouncer(orphan_tx->GetWitnessHash(), peer);
192192
}
193193

@@ -224,7 +224,7 @@ bool TxDownloadManagerImpl::AddTxAnnouncement(NodeId peer, const GenTxid& gtxid,
224224
return false;
225225
}
226226

227-
bool TxDownloadManagerImpl::OrphanResolutionCandidate(const std::vector<Txid>& unique_parents, const Wtxid& wtxid, NodeId nodeid, std::chrono::microseconds now)
227+
bool TxDownloadManagerImpl::MaybeAddOrphanResolutionCandidate(const std::vector<Txid>& unique_parents, const Wtxid& wtxid, NodeId nodeid, std::chrono::microseconds now)
228228
{
229229
auto it_peer = m_peer_info.find(nodeid);
230230
if (it_peer == m_peer_info.end()) return false;
@@ -402,7 +402,7 @@ node::RejectedTxTodo TxDownloadManagerImpl::MempoolRejectedTx(const CTransaction
402402
add_extra_compact_tx &= !m_orphanage.HaveTx(wtxid);
403403

404404
auto add_orphan_reso_candidate = [&](const CTransactionRef& orphan_tx, const std::vector<Txid>& unique_parents, NodeId nodeid, std::chrono::microseconds now) {
405-
if (OrphanResolutionCandidate(unique_parents, orphan_tx->GetWitnessHash(), nodeid, now)) {
405+
if (MaybeAddOrphanResolutionCandidate(unique_parents, orphan_tx->GetWitnessHash(), nodeid, now)) {
406406
m_orphanage.AddTx(orphan_tx, nodeid);
407407
}
408408
};

src/node/txdownloadman_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class TxDownloadManagerImpl {
198198
* this peer; add them as new invs to m_txrequest.
199199
* @returns whether this transaction was a valid orphan resolution candidate.
200200
* */
201-
bool OrphanResolutionCandidate(const std::vector<Txid>& unique_parents, const Wtxid& wtxid, NodeId nodeid, std::chrono::microseconds now);
201+
bool MaybeAddOrphanResolutionCandidate(const std::vector<Txid>& unique_parents, const Wtxid& wtxid, NodeId nodeid, std::chrono::microseconds now);
202202
};
203203
} // namespace node
204204
#endif // BITCOIN_NODE_TXDOWNLOADMAN_IMPL_H

0 commit comments

Comments
 (0)