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.cpp | |
parent | a17df4e876f9a24b4c24023b9346d2392db53c4d (diff) |
[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.cpp')
-rw-r--r-- | src/net.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/net.cpp b/src/net.cpp index 955eec46e3..d9c309811d 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1112,18 +1112,11 @@ bool CConnman::AttemptToEvictConnection() continue; if (node->fDisconnect) continue; - bool peer_relay_txes = false; - bool peer_filter_not_null = false; - if (node->m_tx_relay != nullptr) { - LOCK(node->m_tx_relay->cs_filter); - peer_relay_txes = node->m_tx_relay->fRelayTxes; - peer_filter_not_null = node->m_tx_relay->pfilter != nullptr; - } NodeEvictionCandidate candidate = {node->GetId(), node->m_connected, node->m_min_ping_time, node->m_last_block_time, node->m_last_tx_time, HasAllDesirableServiceFlags(node->nServices), - peer_relay_txes, peer_filter_not_null, node->nKeyedNetGroup, - node->m_prefer_evict, node->addr.IsLocal(), + node->m_relays_txs.load(), node->m_bloom_filter_loaded.load(), + node->nKeyedNetGroup, node->m_prefer_evict, node->addr.IsLocal(), node->ConnectedThroughNetwork()}; vEvictionCandidates.push_back(candidate); } |