From 68334b39443b3cfd75b0ef815ac40074185386f2 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Thu, 22 Oct 2020 10:46:31 +0100 Subject: [net processing] Add m_ignores_incoming_txs to PeerManager and use internally --- src/net_processing.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/net_processing.h') diff --git a/src/net_processing.h b/src/net_processing.h index cb34935ad1..d5b54dae56 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -76,7 +76,8 @@ using PeerRef = std::shared_ptr; class PeerManager final : public CValidationInterface, public NetEventsInterface { public: PeerManager(const CChainParams& chainparams, CConnman& connman, BanMan* banman, - CScheduler& scheduler, ChainstateManager& chainman, CTxMemPool& pool); + CScheduler& scheduler, ChainstateManager& chainman, CTxMemPool& pool, + bool ignore_incoming_txs); /** * Overridden from CValidationInterface. @@ -139,7 +140,7 @@ public: bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats); /** Whether this node ignores txs received over p2p. */ - bool IgnoresIncomingTxs() {return !::g_relay_txes;}; + bool IgnoresIncomingTxs() {return m_ignore_incoming_txs;}; private: /** Get a shared pointer to the Peer object. @@ -202,6 +203,9 @@ private: int64_t m_stale_tip_check_time; //!< Next time to check for stale tip + //* Whether this node is running in blocks only mode */ + const bool m_ignore_incoming_txs; + /** Protects m_peer_map */ mutable Mutex m_peer_mutex; /** -- cgit v1.2.3