diff options
author | dergoegge <n.goeggi@gmail.com> | 2023-11-29 12:03:49 +0000 |
---|---|---|
committer | stickies-v <stickies-v@protonmail.com> | 2024-04-10 17:01:27 +0200 |
commit | 92e72b5d0d49aa395e626c238bc28aba8e4c3d44 (patch) | |
tree | 559ee35563847f2d6a4cfe6011fd6d32ad8fa7a1 | |
parent | 7d9c3ec622d73a98d07ab3cee78751718982a5bc (diff) | |
download | bitcoin-92e72b5d0d49aa395e626c238bc28aba8e4c3d44.tar.xz |
[net processing] Move IgnoresIncomingTxs to PeerManagerInfo
-rw-r--r-- | src/net_processing.cpp | 2 | ||||
-rw-r--r-- | src/net_processing.h | 4 | ||||
-rw-r--r-- | src/rpc/net.cpp | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 6289d13989..0a6f180ab4 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -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, }; } diff --git a/src/net_processing.h b/src/net_processing.h index d0ff02311b..85e399d948 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -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; diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 823b6d620f..e3d50917a5 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -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) { |