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:
1 parent
cc50f2f0df
commit
8a58d0e87d
8 files changed
+16
-16
No files matched your search
@@ -533,7 +533,7 @@ public:
|
|||||||
std::optional<std::string> FetchBlock(NodeId peer_id, const CBlockIndex& block_index) override
|
std::optional<std::string> FetchBlock(NodeId peer_id, const CBlockIndex& block_index) override
|
||||||
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
||||||
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) const override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) const override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
||||||
std::vector<node::TxOrphanage::OrphanTxBase> GetOrphanTransactions() override EXCLUSIVE_LOCKS_REQUIRED(!m_tx_download_mutex);
|
std::vector<node::TxOrphanage::OrphanInfo> GetOrphanTransactions() override EXCLUSIVE_LOCKS_REQUIRED(!m_tx_download_mutex);
|
||||||
PeerManagerInfo GetInfo() const override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
PeerManagerInfo GetInfo() const override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
||||||
void SendPings() override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
void SendPings() override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
||||||
void RelayTransaction(const Txid& txid, const Wtxid& wtxid) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
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
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<node::TxOrphanage::OrphanTxBase> PeerManagerImpl::GetOrphanTransactions()
|
std::vector<node::TxOrphanage::OrphanInfo> PeerManagerImpl::GetOrphanTransactions()
|
||||||
{
|
{
|
||||||
LOCK(m_tx_download_mutex);
|
LOCK(m_tx_download_mutex);
|
||||||
return m_txdownloadman.GetOrphanTransactions();
|
return m_txdownloadman.GetOrphanTransactions();
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ public:
|
|||||||
/** Get statistics from node state */
|
/** Get statistics from node state */
|
||||||
virtual bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) const = 0;
|
virtual bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) const = 0;
|
||||||
|
|
||||||
virtual std::vector<node::TxOrphanage::OrphanTxBase> GetOrphanTransactions() = 0;
|
virtual std::vector<node::TxOrphanage::OrphanInfo> GetOrphanTransactions() = 0;
|
||||||
|
|
||||||
/** Get peer manager info. */
|
/** Get peer manager info. */
|
||||||
virtual PeerManagerInfo GetInfo() const = 0;
|
virtual PeerManagerInfo GetInfo() const = 0;
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ public:
|
|||||||
void CheckIsEmpty(NodeId nodeid) const;
|
void CheckIsEmpty(NodeId nodeid) const;
|
||||||
|
|
||||||
/** Wrapper for TxOrphanage::GetOrphanTransactions */
|
/** Wrapper for TxOrphanage::GetOrphanTransactions */
|
||||||
std::vector<TxOrphanage::OrphanTxBase> GetOrphanTransactions() const;
|
std::vector<TxOrphanage::OrphanInfo> GetOrphanTransactions() const;
|
||||||
};
|
};
|
||||||
} // namespace node
|
} // namespace node
|
||||||
#endif // BITCOIN_NODE_TXDOWNLOADMAN_H
|
#endif // BITCOIN_NODE_TXDOWNLOADMAN_H
|
||||||
@@ -83,7 +83,7 @@ void TxDownloadManager::CheckIsEmpty(NodeId nodeid) const
|
|||||||
{
|
{
|
||||||
m_impl->CheckIsEmpty(nodeid);
|
m_impl->CheckIsEmpty(nodeid);
|
||||||
}
|
}
|
||||||
std::vector<TxOrphanage::OrphanTxBase> TxDownloadManager::GetOrphanTransactions() const
|
std::vector<TxOrphanage::OrphanInfo> TxDownloadManager::GetOrphanTransactions() const
|
||||||
{
|
{
|
||||||
return m_impl->GetOrphanTransactions();
|
return m_impl->GetOrphanTransactions();
|
||||||
}
|
}
|
||||||
@@ -576,7 +576,7 @@ void TxDownloadManagerImpl::CheckIsEmpty()
|
|||||||
assert(m_txrequest.Size() == 0);
|
assert(m_txrequest.Size() == 0);
|
||||||
assert(m_num_wtxid_peers == 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();
|
return m_orphanage->GetOrphanTransactions();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ public:
|
|||||||
void CheckIsEmpty();
|
void CheckIsEmpty();
|
||||||
void CheckIsEmpty(NodeId nodeid);
|
void CheckIsEmpty(NodeId nodeid);
|
||||||
|
|
||||||
std::vector<TxOrphanage::OrphanTxBase> GetOrphanTransactions() const;
|
std::vector<TxOrphanage::OrphanInfo> GetOrphanTransactions() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/** Helper for getting deduplicated vector of Txids in vin. */
|
/** 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;
|
std::vector<std::pair<Wtxid, NodeId>> AddChildrenToWorkSet(const CTransaction& tx, FastRandomContext& rng) override;
|
||||||
bool HaveTxToReconsider(NodeId peer) override;
|
bool HaveTxToReconsider(NodeId peer) override;
|
||||||
std::vector<CTransactionRef> GetChildrenFromSamePeer(const CTransactionRef& parent, NodeId nodeid) const 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;
|
TxOrphanage::Usage TotalOrphanUsage() const override;
|
||||||
void SanityCheck() const override;
|
void SanityCheck() const override;
|
||||||
};
|
};
|
||||||
@@ -665,9 +665,9 @@ std::vector<CTransactionRef> TxOrphanageImpl::GetChildrenFromSamePeer(const CTra
|
|||||||
return children_found;
|
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);
|
result.reserve(m_unique_orphans);
|
||||||
|
|
||||||
auto& index_by_wtxid = m_orphans.get<ByWtxid>();
|
auto& index_by_wtxid = m_orphans.get<ByWtxid>();
|
||||||
@@ -675,7 +675,7 @@ std::vector<TxOrphanage::OrphanTxBase> TxOrphanageImpl::GetOrphanTransactions()
|
|||||||
std::set<NodeId> this_orphan_announcers;
|
std::set<NodeId> this_orphan_announcers;
|
||||||
while (it != index_by_wtxid.end()) {
|
while (it != index_by_wtxid.end()) {
|
||||||
this_orphan_announcers.insert(it->m_announcer);
|
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()) {
|
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));
|
result.emplace_back(it->m_tx, std::move(this_orphan_announcers));
|
||||||
this_orphan_announcers.clear();
|
this_orphan_announcers.clear();
|
||||||
|
|||||||
@@ -41,13 +41,13 @@ public:
|
|||||||
using Count = unsigned int;
|
using Count = unsigned int;
|
||||||
|
|
||||||
/** Allows providing orphan information externally */
|
/** Allows providing orphan information externally */
|
||||||
struct OrphanTxBase {
|
struct OrphanInfo {
|
||||||
CTransactionRef tx;
|
CTransactionRef tx;
|
||||||
/** Peers added with AddTx or AddAnnouncer. */
|
/** Peers added with AddTx or AddAnnouncer. */
|
||||||
std::set<NodeId> announcers;
|
std::set<NodeId> announcers;
|
||||||
|
|
||||||
// Constructor with moved announcers
|
// Constructor with moved announcers
|
||||||
OrphanTxBase(CTransactionRef tx, std::set<NodeId>&& announcers) :
|
OrphanInfo(CTransactionRef tx, std::set<NodeId>&& announcers) :
|
||||||
tx(std::move(tx)),
|
tx(std::move(tx)),
|
||||||
announcers(std::move(announcers))
|
announcers(std::move(announcers))
|
||||||
{}
|
{}
|
||||||
@@ -99,7 +99,7 @@ public:
|
|||||||
virtual std::vector<CTransactionRef> GetChildrenFromSamePeer(const CTransactionRef& parent, NodeId nodeid) const = 0;
|
virtual std::vector<CTransactionRef> GetChildrenFromSamePeer(const CTransactionRef& parent, NodeId nodeid) const = 0;
|
||||||
|
|
||||||
/** Get all orphan transactions */
|
/** 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
|
/** Get the total usage (weight) of all orphans. If an orphan has multiple announcers, its usage is
|
||||||
* only counted once within this total. */
|
* only counted once within this total. */
|
||||||
|
|||||||
+2
-2
@@ -839,7 +839,7 @@ static std::vector<RPCResult> OrphanDescription()
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static UniValue OrphanToJSON(const node::TxOrphanage::OrphanTxBase& orphan)
|
static UniValue OrphanToJSON(const node::TxOrphanage::OrphanInfo& orphan)
|
||||||
{
|
{
|
||||||
UniValue o(UniValue::VOBJ);
|
UniValue o(UniValue::VOBJ);
|
||||||
o.pushKV("txid", orphan.tx->GetHash().ToString());
|
o.pushKV("txid", orphan.tx->GetHash().ToString());
|
||||||
@@ -895,7 +895,7 @@ static RPCHelpMan getorphantxs()
|
|||||||
{
|
{
|
||||||
const NodeContext& node = EnsureAnyNodeContext(request.context);
|
const NodeContext& node = EnsureAnyNodeContext(request.context);
|
||||||
PeerManager& peerman = EnsurePeerman(node);
|
PeerManager& peerman = EnsurePeerman(node);
|
||||||
std::vector<node::TxOrphanage::OrphanTxBase> orphanage = peerman.GetOrphanTransactions();
|
std::vector<node::TxOrphanage::OrphanInfo> orphanage = peerman.GetOrphanTransactions();
|
||||||
|
|
||||||
int verbosity{ParseVerbosity(request.params[0], /*default_verbosity=*/0, /*allow_bool*/false)};
|
int verbosity{ParseVerbosity(request.params[0], /*default_verbosity=*/0, /*allow_bool*/false)};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user