mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01:00
net: attempt v2 transport for addrfetch connections if we support it
This commit is contained in:
parent
770c0311ef
commit
9eed22e870
1 changed files with 4 additions and 1 deletions
|
@ -2322,10 +2322,13 @@ void CConnman::ProcessAddrFetch()
|
||||||
strDest = m_addr_fetches.front();
|
strDest = m_addr_fetches.front();
|
||||||
m_addr_fetches.pop_front();
|
m_addr_fetches.pop_front();
|
||||||
}
|
}
|
||||||
|
// Attempt v2 connection if we support v2 - we'll reconnect with v1 if our
|
||||||
|
// peer doesn't support it or immediately disconnects us for another reason.
|
||||||
|
const bool use_v2transport(GetLocalServices() & NODE_P2P_V2);
|
||||||
CAddress addr;
|
CAddress addr;
|
||||||
CSemaphoreGrant grant(*semOutbound, /*fTry=*/true);
|
CSemaphoreGrant grant(*semOutbound, /*fTry=*/true);
|
||||||
if (grant) {
|
if (grant) {
|
||||||
OpenNetworkConnection(addr, false, std::move(grant), strDest.c_str(), ConnectionType::ADDR_FETCH, /*use_v2transport=*/false);
|
OpenNetworkConnection(addr, false, std::move(grant), strDest.c_str(), ConnectionType::ADDR_FETCH, use_v2transport);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue