mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
[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.
This commit is contained in:
11
src/net.cpp
11
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user