[net processing] Move IgnoresIncomingTxs to PeerManagerInfo

This commit is contained in:
dergoegge authored and stickies-v committed 2024-04-10 17:01:27 +02:00
1 parent 7d9c3ec622
commit 92e72b5d0d
3 files changed
+3 -5

No files matched your search

+1 -1
View File
@@ -519,7 +519,6 @@ public:
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);
void SetBestBlock(int height, std::chrono::seconds time) override
@@ -1809,6 +1808,7 @@ PeerManagerInfo PeerManagerImpl::GetInfo() const
{
return PeerManagerInfo{
.median_outbound_time_offset = m_outbound_time_offsets.Median(),
.ignores_incoming_txs = m_opts.ignore_incoming_txs,
};
}
+1 -3
View File
@@ -48,6 +48,7 @@ struct CNodeStateStats {
struct PeerManagerInfo {
std::chrono::seconds median_outbound_time_offset{0s};
bool ignores_incoming_txs{false};
};
class PeerManager : public CValidationInterface, public NetEventsInterface
@@ -93,9 +94,6 @@ public:
/** Get peer manager info. */
virtual PeerManagerInfo GetInfo() const = 0;
/** Whether this node ignores txs received over p2p. */
virtual bool IgnoresIncomingTxs() = 0;
/** Relay transaction to all peers. */
virtual void RelayTransaction(const uint256& txid, const uint256& wtxid) = 0;
+1 -1
View File
@@ -679,7 +679,7 @@ static RPCHelpMan getnetworkinfo()
}
if (node.peerman) {
auto peerman_info{node.peerman->GetInfo()};
obj.pushKV("localrelay", !node.peerman->IgnoresIncomingTxs());
obj.pushKV("localrelay", !peerman_info.ignores_incoming_txs);
obj.pushKV("timeoffset", Ticks<std::chrono::seconds>(peerman_info.median_outbound_time_offset));
}
if (node.connman) {