mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
[net processing] Introduce PeerManagerInfo
For querying statistics/info from PeerManager. The median outbound time offset is the only initial field.
This commit is contained in:
parent
ee178dfcc1
commit
7d9c3ec622
3 changed files with 17 additions and 2 deletions
|
|
@ -518,6 +518,7 @@ public:
|
|||
std::optional<std::string> FetchBlock(NodeId peer_id, const CBlockIndex& block_index) override
|
||||
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
||||
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) const override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
||||
PeerManagerInfo GetInfo() const override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
||||
bool IgnoresIncomingTxs() override { return m_opts.ignore_incoming_txs; }
|
||||
void SendPings() override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
||||
void RelayTransaction(const uint256& txid, const uint256& wtxid) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
||||
|
|
@ -1804,6 +1805,13 @@ bool PeerManagerImpl::GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) c
|
|||
return true;
|
||||
}
|
||||
|
||||
PeerManagerInfo PeerManagerImpl::GetInfo() const
|
||||
{
|
||||
return PeerManagerInfo{
|
||||
.median_outbound_time_offset = m_outbound_time_offsets.Median(),
|
||||
};
|
||||
}
|
||||
|
||||
void PeerManagerImpl::AddToCompactExtraTransactions(const CTransactionRef& tx)
|
||||
{
|
||||
if (m_opts.max_extra_txs <= 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue