Skip to content

Commit 8a58d0e

Browse files
committed
scripted-diff: rename OrphanTxBase to OrphanInfo
-BEGIN VERIFY SCRIPT- sed -i 's/OrphanTxBase/OrphanInfo/g' $(git grep -l 'OrphanTxBase') -END VERIFY SCRIPT-
1 parent cc50f2f commit 8a58d0e

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

src/net_processing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ class PeerManagerImpl final : public PeerManager
533533
std::optional<std::string> FetchBlock(NodeId peer_id, const CBlockIndex& block_index) override
534534
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
535535
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) const override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
536-
std::vector<node::TxOrphanage::OrphanTxBase> GetOrphanTransactions() override EXCLUSIVE_LOCKS_REQUIRED(!m_tx_download_mutex);
536+
std::vector<node::TxOrphanage::OrphanInfo> GetOrphanTransactions() override EXCLUSIVE_LOCKS_REQUIRED(!m_tx_download_mutex);
537537
PeerManagerInfo GetInfo() const override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
538538
void SendPings() override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
539539
void RelayTransaction(const Txid& txid, const Wtxid& wtxid) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
@@ -1754,7 +1754,7 @@ bool PeerManagerImpl::GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) c
17541754
return true;
17551755
}
17561756

1757-
std::vector<node::TxOrphanage::OrphanTxBase> PeerManagerImpl::GetOrphanTransactions()
1757+
std::vector<node::TxOrphanage::OrphanInfo> PeerManagerImpl::GetOrphanTransactions()
17581758
{
17591759
LOCK(m_tx_download_mutex);
17601760
return m_txdownloadman.GetOrphanTransactions();

src/net_processing.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class PeerManager : public CValidationInterface, public NetEventsInterface
109109
/** Get statistics from node state */
110110
virtual bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) const = 0;
111111

112-
virtual std::vector<node::TxOrphanage::OrphanTxBase> GetOrphanTransactions() = 0;
112+
virtual std::vector<node::TxOrphanage::OrphanInfo> GetOrphanTransactions() = 0;
113113

114114
/** Get peer manager info. */
115115
virtual PeerManagerInfo GetInfo() const = 0;

src/node/txdownloadman.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class TxDownloadManager {
170170
void CheckIsEmpty(NodeId nodeid) const;
171171

172172
/** Wrapper for TxOrphanage::GetOrphanTransactions */
173-
std::vector<TxOrphanage::OrphanTxBase> GetOrphanTransactions() const;
173+
std::vector<TxOrphanage::OrphanInfo> GetOrphanTransactions() const;
174174
};
175175
} // namespace node
176176
#endif // BITCOIN_NODE_TXDOWNLOADMAN_H

src/node/txdownloadman_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void TxDownloadManager::CheckIsEmpty(NodeId nodeid) const
8383
{
8484
m_impl->CheckIsEmpty(nodeid);
8585
}
86-
std::vector<TxOrphanage::OrphanTxBase> TxDownloadManager::GetOrphanTransactions() const
86+
std::vector<TxOrphanage::OrphanInfo> TxDownloadManager::GetOrphanTransactions() const
8787
{
8888
return m_impl->GetOrphanTransactions();
8989
}
@@ -576,7 +576,7 @@ void TxDownloadManagerImpl::CheckIsEmpty()
576576
assert(m_txrequest.Size() == 0);
577577
assert(m_num_wtxid_peers == 0);
578578
}
579-
std::vector<TxOrphanage::OrphanTxBase> TxDownloadManagerImpl::GetOrphanTransactions() const
579+
std::vector<TxOrphanage::OrphanInfo> TxDownloadManagerImpl::GetOrphanTransactions() const
580580
{
581581
return m_orphanage->GetOrphanTransactions();
582582
}

src/node/txdownloadman_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class TxDownloadManagerImpl {
188188
void CheckIsEmpty();
189189
void CheckIsEmpty(NodeId nodeid);
190190

191-
std::vector<TxOrphanage::OrphanTxBase> GetOrphanTransactions() const;
191+
std::vector<TxOrphanage::OrphanInfo> GetOrphanTransactions() const;
192192

193193
protected:
194194
/** Helper for getting deduplicated vector of Txids in vin. */

src/node/txorphanage.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class TxOrphanageImpl final : public TxOrphanage {
229229
std::vector<std::pair<Wtxid, NodeId>> AddChildrenToWorkSet(const CTransaction& tx, FastRandomContext& rng) override;
230230
bool HaveTxToReconsider(NodeId peer) override;
231231
std::vector<CTransactionRef> GetChildrenFromSamePeer(const CTransactionRef& parent, NodeId nodeid) const override;
232-
std::vector<OrphanTxBase> GetOrphanTransactions() const override;
232+
std::vector<OrphanInfo> GetOrphanTransactions() const override;
233233
TxOrphanage::Usage TotalOrphanUsage() const override;
234234
void SanityCheck() const override;
235235
};
@@ -665,17 +665,17 @@ std::vector<CTransactionRef> TxOrphanageImpl::GetChildrenFromSamePeer(const CTra
665665
return children_found;
666666
}
667667

668-
std::vector<TxOrphanage::OrphanTxBase> TxOrphanageImpl::GetOrphanTransactions() const
668+
std::vector<TxOrphanage::OrphanInfo> TxOrphanageImpl::GetOrphanTransactions() const
669669
{
670-
std::vector<TxOrphanage::OrphanTxBase> result;
670+
std::vector<TxOrphanage::OrphanInfo> result;
671671
result.reserve(m_unique_orphans);
672672

673673
auto& index_by_wtxid = m_orphans.get<ByWtxid>();
674674
auto it = index_by_wtxid.begin();
675675
std::set<NodeId> this_orphan_announcers;
676676
while (it != index_by_wtxid.end()) {
677677
this_orphan_announcers.insert(it->m_announcer);
678-
// If this is the last entry, or the next entry has a different wtxid, build a OrphanTxBase.
678+
// If this is the last entry, or the next entry has a different wtxid, build a OrphanInfo.
679679
if (std::next(it) == index_by_wtxid.end() || std::next(it)->m_tx->GetWitnessHash() != it->m_tx->GetWitnessHash()) {
680680
result.emplace_back(it->m_tx, std::move(this_orphan_announcers));
681681
this_orphan_announcers.clear();

src/node/txorphanage.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ class TxOrphanage {
4141
using Count = unsigned int;
4242

4343
/** Allows providing orphan information externally */
44-
struct OrphanTxBase {
44+
struct OrphanInfo {
4545
CTransactionRef tx;
4646
/** Peers added with AddTx or AddAnnouncer. */
4747
std::set<NodeId> announcers;
4848

4949
// Constructor with moved announcers
50-
OrphanTxBase(CTransactionRef tx, std::set<NodeId>&& announcers) :
50+
OrphanInfo(CTransactionRef tx, std::set<NodeId>&& announcers) :
5151
tx(std::move(tx)),
5252
announcers(std::move(announcers))
5353
{}
@@ -99,7 +99,7 @@ class TxOrphanage {
9999
virtual std::vector<CTransactionRef> GetChildrenFromSamePeer(const CTransactionRef& parent, NodeId nodeid) const = 0;
100100

101101
/** Get all orphan transactions */
102-
virtual std::vector<OrphanTxBase> GetOrphanTransactions() const = 0;
102+
virtual std::vector<OrphanInfo> GetOrphanTransactions() const = 0;
103103

104104
/** Get the total usage (weight) of all orphans. If an orphan has multiple announcers, its usage is
105105
* only counted once within this total. */

src/rpc/mempool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ static std::vector<RPCResult> OrphanDescription()
839839
};
840840
}
841841

842-
static UniValue OrphanToJSON(const node::TxOrphanage::OrphanTxBase& orphan)
842+
static UniValue OrphanToJSON(const node::TxOrphanage::OrphanInfo& orphan)
843843
{
844844
UniValue o(UniValue::VOBJ);
845845
o.pushKV("txid", orphan.tx->GetHash().ToString());
@@ -895,7 +895,7 @@ static RPCHelpMan getorphantxs()
895895
{
896896
const NodeContext& node = EnsureAnyNodeContext(request.context);
897897
PeerManager& peerman = EnsurePeerman(node);
898-
std::vector<node::TxOrphanage::OrphanTxBase> orphanage = peerman.GetOrphanTransactions();
898+
std::vector<node::TxOrphanage::OrphanInfo> orphanage = peerman.GetOrphanTransactions();
899899

900900
int verbosity{ParseVerbosity(request.params[0], /*default_verbosity=*/0, /*allow_bool*/false)};
901901

0 commit comments

Comments
 (0)