From 6e4d392a7536d9c5e1afc60196ee82195dbfec35 Mon Sep 17 00:00:00 2001 From: glozow Date: Wed, 29 Jan 2025 18:05:09 -0500 Subject: [PATCH] [refactor] rename to OrphanResolutionCandidate to MaybeAdd* --- src/node/txdownloadman_impl.cpp | 6 +++--- src/node/txdownloadman_impl.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node/txdownloadman_impl.cpp b/src/node/txdownloadman_impl.cpp index 01f34961ad0..9829d0a0b48 100644 --- a/src/node/txdownloadman_impl.cpp +++ b/src/node/txdownloadman_impl.cpp @@ -187,7 +187,7 @@ bool TxDownloadManagerImpl::AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, if (unique_parents.empty()) return true; - if (OrphanResolutionCandidate(unique_parents, orphan_tx->GetWitnessHash(), peer, now)) { + if (MaybeAddOrphanResolutionCandidate(unique_parents, orphan_tx->GetWitnessHash(), peer, now)) { m_orphanage.AddAnnouncer(orphan_tx->GetWitnessHash(), peer); } @@ -224,7 +224,7 @@ bool TxDownloadManagerImpl::AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, return false; } -bool TxDownloadManagerImpl::OrphanResolutionCandidate(const std::vector& unique_parents, const Wtxid& wtxid, NodeId nodeid, std::chrono::microseconds now) +bool TxDownloadManagerImpl::MaybeAddOrphanResolutionCandidate(const std::vector& unique_parents, const Wtxid& wtxid, NodeId nodeid, std::chrono::microseconds now) { auto it_peer = m_peer_info.find(nodeid); if (it_peer == m_peer_info.end()) return false; @@ -402,7 +402,7 @@ node::RejectedTxTodo TxDownloadManagerImpl::MempoolRejectedTx(const CTransaction add_extra_compact_tx &= !m_orphanage.HaveTx(wtxid); auto add_orphan_reso_candidate = [&](const CTransactionRef& orphan_tx, const std::vector& unique_parents, NodeId nodeid, std::chrono::microseconds now) { - if (OrphanResolutionCandidate(unique_parents, orphan_tx->GetWitnessHash(), nodeid, now)) { + if (MaybeAddOrphanResolutionCandidate(unique_parents, orphan_tx->GetWitnessHash(), nodeid, now)) { m_orphanage.AddTx(orphan_tx, nodeid); } }; diff --git a/src/node/txdownloadman_impl.h b/src/node/txdownloadman_impl.h index dc8a12c372a..d9688d0c8d8 100644 --- a/src/node/txdownloadman_impl.h +++ b/src/node/txdownloadman_impl.h @@ -198,7 +198,7 @@ protected: * this peer; add them as new invs to m_txrequest. * @returns whether this transaction was a valid orphan resolution candidate. * */ - bool OrphanResolutionCandidate(const std::vector& unique_parents, const Wtxid& wtxid, NodeId nodeid, std::chrono::microseconds now); + bool MaybeAddOrphanResolutionCandidate(const std::vector& unique_parents, const Wtxid& wtxid, NodeId nodeid, std::chrono::microseconds now); }; } // namespace node #endif // BITCOIN_NODE_TXDOWNLOADMAN_IMPL_H