mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
scripted-diff: rename OrphanTxBase to OrphanInfo
-BEGIN VERIFY SCRIPT- sed -i 's/OrphanTxBase/OrphanInfo/g' $(git grep -l 'OrphanTxBase') -END VERIFY SCRIPT-
This commit is contained in:
@@ -170,7 +170,7 @@ public:
|
||||
void CheckIsEmpty(NodeId nodeid) const;
|
||||
|
||||
/** Wrapper for TxOrphanage::GetOrphanTransactions */
|
||||
std::vector<TxOrphanage::OrphanTxBase> GetOrphanTransactions() const;
|
||||
std::vector<TxOrphanage::OrphanInfo> GetOrphanTransactions() const;
|
||||
};
|
||||
} // namespace node
|
||||
#endif // BITCOIN_NODE_TXDOWNLOADMAN_H
|
||||
|
||||
@@ -83,7 +83,7 @@ void TxDownloadManager::CheckIsEmpty(NodeId nodeid) const
|
||||
{
|
||||
m_impl->CheckIsEmpty(nodeid);
|
||||
}
|
||||
std::vector<TxOrphanage::OrphanTxBase> TxDownloadManager::GetOrphanTransactions() const
|
||||
std::vector<TxOrphanage::OrphanInfo> TxDownloadManager::GetOrphanTransactions() const
|
||||
{
|
||||
return m_impl->GetOrphanTransactions();
|
||||
}
|
||||
@@ -576,7 +576,7 @@ void TxDownloadManagerImpl::CheckIsEmpty()
|
||||
assert(m_txrequest.Size() == 0);
|
||||
assert(m_num_wtxid_peers == 0);
|
||||
}
|
||||
std::vector<TxOrphanage::OrphanTxBase> TxDownloadManagerImpl::GetOrphanTransactions() const
|
||||
std::vector<TxOrphanage::OrphanInfo> TxDownloadManagerImpl::GetOrphanTransactions() const
|
||||
{
|
||||
return m_orphanage->GetOrphanTransactions();
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ public:
|
||||
void CheckIsEmpty();
|
||||
void CheckIsEmpty(NodeId nodeid);
|
||||
|
||||
std::vector<TxOrphanage::OrphanTxBase> GetOrphanTransactions() const;
|
||||
std::vector<TxOrphanage::OrphanInfo> GetOrphanTransactions() const;
|
||||
|
||||
protected:
|
||||
/** Helper for getting deduplicated vector of Txids in vin. */
|
||||
|
||||
@@ -229,7 +229,7 @@ public:
|
||||
std::vector<std::pair<Wtxid, NodeId>> AddChildrenToWorkSet(const CTransaction& tx, FastRandomContext& rng) override;
|
||||
bool HaveTxToReconsider(NodeId peer) override;
|
||||
std::vector<CTransactionRef> GetChildrenFromSamePeer(const CTransactionRef& parent, NodeId nodeid) const override;
|
||||
std::vector<OrphanTxBase> GetOrphanTransactions() const override;
|
||||
std::vector<OrphanInfo> GetOrphanTransactions() const override;
|
||||
TxOrphanage::Usage TotalOrphanUsage() const override;
|
||||
void SanityCheck() const override;
|
||||
};
|
||||
@@ -665,9 +665,9 @@ std::vector<CTransactionRef> TxOrphanageImpl::GetChildrenFromSamePeer(const CTra
|
||||
return children_found;
|
||||
}
|
||||
|
||||
std::vector<TxOrphanage::OrphanTxBase> TxOrphanageImpl::GetOrphanTransactions() const
|
||||
std::vector<TxOrphanage::OrphanInfo> TxOrphanageImpl::GetOrphanTransactions() const
|
||||
{
|
||||
std::vector<TxOrphanage::OrphanTxBase> result;
|
||||
std::vector<TxOrphanage::OrphanInfo> result;
|
||||
result.reserve(m_unique_orphans);
|
||||
|
||||
auto& index_by_wtxid = m_orphans.get<ByWtxid>();
|
||||
@@ -675,7 +675,7 @@ std::vector<TxOrphanage::OrphanTxBase> TxOrphanageImpl::GetOrphanTransactions()
|
||||
std::set<NodeId> this_orphan_announcers;
|
||||
while (it != index_by_wtxid.end()) {
|
||||
this_orphan_announcers.insert(it->m_announcer);
|
||||
// If this is the last entry, or the next entry has a different wtxid, build a OrphanTxBase.
|
||||
// If this is the last entry, or the next entry has a different wtxid, build a OrphanInfo.
|
||||
if (std::next(it) == index_by_wtxid.end() || std::next(it)->m_tx->GetWitnessHash() != it->m_tx->GetWitnessHash()) {
|
||||
result.emplace_back(it->m_tx, std::move(this_orphan_announcers));
|
||||
this_orphan_announcers.clear();
|
||||
|
||||
@@ -41,13 +41,13 @@ public:
|
||||
using Count = unsigned int;
|
||||
|
||||
/** Allows providing orphan information externally */
|
||||
struct OrphanTxBase {
|
||||
struct OrphanInfo {
|
||||
CTransactionRef tx;
|
||||
/** Peers added with AddTx or AddAnnouncer. */
|
||||
std::set<NodeId> announcers;
|
||||
|
||||
// Constructor with moved announcers
|
||||
OrphanTxBase(CTransactionRef tx, std::set<NodeId>&& announcers) :
|
||||
OrphanInfo(CTransactionRef tx, std::set<NodeId>&& announcers) :
|
||||
tx(std::move(tx)),
|
||||
announcers(std::move(announcers))
|
||||
{}
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
virtual std::vector<CTransactionRef> GetChildrenFromSamePeer(const CTransactionRef& parent, NodeId nodeid) const = 0;
|
||||
|
||||
/** Get all orphan transactions */
|
||||
virtual std::vector<OrphanTxBase> GetOrphanTransactions() const = 0;
|
||||
virtual std::vector<OrphanInfo> GetOrphanTransactions() const = 0;
|
||||
|
||||
/** Get the total usage (weight) of all orphans. If an orphan has multiple announcers, its usage is
|
||||
* only counted once within this total. */
|
||||
|
||||
Reference in New Issue
Block a user