Add m_inbound_onion to AttemptToEvictConnection()

and an `m_is_onion` struct member to NodeEvictionCandidate and tests.

We'll use these in the peer eviction logic to protect inbound onion peers
in addition to the existing protection of localhost peers.
This commit is contained in:
Jon Atack
2020-12-25 23:56:17 +01:00
parent 72e30e8e03
commit 8b1e156143
4 changed files with 6 additions and 1 deletions

View File

@@ -992,7 +992,8 @@ bool CConnman::AttemptToEvictConnection()
node->nLastBlockTime, node->nLastTXTime,
HasAllDesirableServiceFlags(node->nServices),
peer_relay_txes, peer_filter_not_null, node->nKeyedNetGroup,
node->m_prefer_evict, node->addr.IsLocal()};
node->m_prefer_evict, node->addr.IsLocal(),
node->m_inbound_onion};
vEvictionCandidates.push_back(candidate);
}
}