mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
[net processing] Add m_ignores_incoming_txs to PeerManager and use internally
This commit is contained in:
@@ -76,7 +76,8 @@ using PeerRef = std::shared_ptr<Peer>;
|
||||
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;
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user