mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04:00
net: disable v1 connections, reconnections on clearnet
if `-v2onlyclearnet` is turned on, - v1 addresses from addrman aren't selected and manual connections aren't attempted for outbound connections if it's from IPV4/IPV6 networks. - v1 downgrade mechainm is not attempted if v2 connection wasn't successful
This commit is contained in:
parent
d166ed79e5
commit
19d1bc2328
1 changed files with 4 additions and 1 deletions
|
@ -463,6 +463,9 @@ CNode* CConnman::ConnectNode(CAddress addrConnect, const char *pszDest, bool fCo
|
||||||
std::unique_ptr<i2p::sam::Session> i2p_transient_session;
|
std::unique_ptr<i2p::sam::Session> i2p_transient_session;
|
||||||
|
|
||||||
for (auto& target_addr: connect_to) {
|
for (auto& target_addr: connect_to) {
|
||||||
|
if (DisableV1OnClearnet(target_addr.GetNetClass()) && !use_v2transport) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (target_addr.IsValid()) {
|
if (target_addr.IsValid()) {
|
||||||
const bool use_proxy{GetProxy(target_addr.GetNetwork(), proxy)};
|
const bool use_proxy{GetProxy(target_addr.GetNetwork(), proxy)};
|
||||||
bool proxyConnectionFailed = false;
|
bool proxyConnectionFailed = false;
|
||||||
|
@ -1935,7 +1938,7 @@ void CConnman::DisconnectNodes()
|
||||||
// Add to reconnection list if appropriate. We don't reconnect right here, because
|
// Add to reconnection list if appropriate. We don't reconnect right here, because
|
||||||
// the creation of a connection is a blocking operation (up to several seconds),
|
// the creation of a connection is a blocking operation (up to several seconds),
|
||||||
// and we don't want to hold up the socket handler thread for that long.
|
// and we don't want to hold up the socket handler thread for that long.
|
||||||
if (network_active && pnode->m_transport->ShouldReconnectV1()) {
|
if (network_active && pnode->m_transport->ShouldReconnectV1() && !DisableV1OnClearnet(pnode->addr.GetNetClass())) {
|
||||||
reconnections_to_add.push_back({
|
reconnections_to_add.push_back({
|
||||||
.addr_connect = pnode->addr,
|
.addr_connect = pnode->addr,
|
||||||
.grant = std::move(pnode->grantOutbound),
|
.grant = std::move(pnode->grantOutbound),
|
||||||
|
|
Loading…
Add table
Reference in a new issue