diff options
author | John Newbery <john@johnnewbery.com> | 2021-01-27 20:44:10 +0000 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2022-03-18 11:21:48 +0000 |
commit | 36346703f8558d6781c079c29ddece5a97477beb (patch) | |
tree | f71d9dde8f2b64b443688a1de586e09ed67bfeab /src/net.h | |
parent | a17df4e876f9a24b4c24023b9346d2392db53c4d (diff) | |
download | bitcoin-36346703f8558d6781c079c29ddece5a97477beb.tar.xz |
[net] Add CNode.m_relays_txs and CNode.m_bloom_filter_loaded
We'll move the transaction relay data into Peer in subsequent commits,
but the inbound eviction logic needs to know if the peer is relaying
txs and if the peer has loaded a bloom filter.
This is currently redundant information with m_tx_relay->fRelayTxes,
but when m_tx_relay is moved into net_processing, then we'll need these
separate fields in CNode.
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -577,6 +577,16 @@ public: // m_tx_relay == nullptr if we're not relaying transactions with this peer std::unique_ptr<TxRelay> m_tx_relay; + /** Whether we should relay transactions to this peer (their version + * message did not include fRelay=false and this is not a block-relay-only + * connection). This only changes from false to true. It will never change + * back to false. Used only in inbound eviction logic. */ + std::atomic_bool m_relays_txs{false}; + + /** Whether this peer has loaded a bloom filter. Used only in inbound + * eviction logic. */ + std::atomic_bool m_bloom_filter_loaded{false}; + /** UNIX epoch time of the last block received from this peer that we had * not yet seen (e.g. not already received from another peer), that passed * preliminary validity checks and was saved to disk, even if we don't |