File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -1936,15 +1936,20 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
1936
1936
LogPrint (BCLog::NET, " Making feeler connection to %s\n " , addrConnect.ToString ());
1937
1937
}
1938
1938
1939
- // Open this connection as block-relay-only if we're already at our
1940
- // full-relay capacity, but not yet at our block-relay peer limit.
1941
- bool block_relay_only = nOutboundBlockRelay < m_max_outbound_block_relay && nOutboundFullRelay >= m_max_outbound_full_relay;
1942
1939
ConnectionType conn_type;
1943
- if (fFeeler ) {
1940
+ // Determine what type of connection to open. If fFeeler is not
1941
+ // set, open OUTBOUND connections until we meet our full-relay
1942
+ // capacity. Then open BLOCK_RELAY connections until we hit our
1943
+ // block-relay peer limit. Otherwise, default to opening an
1944
+ // OUTBOUND connection.
1945
+ if (fFeeler ) {
1944
1946
conn_type = ConnectionType::FEELER;
1945
- } else if (block_relay_only) {
1947
+ } else if (nOutboundFullRelay < m_max_outbound_full_relay) {
1948
+ conn_type = ConnectionType::OUTBOUND;
1949
+ } else if (nOutboundBlockRelay < m_max_outbound_block_relay) {
1946
1950
conn_type = ConnectionType::BLOCK_RELAY;
1947
1951
} else {
1952
+ // GetTryNewOutboundPeer() is true
1948
1953
conn_type = ConnectionType::OUTBOUND;
1949
1954
}
1950
1955
You can’t perform that action at this time.
0 commit comments