net: introduce a new connection type for private broadcast

We will open a short-lived connection to a random Tor or I2P peer,
send our transaction to that peer and close the connection.
This commit is contained in:
Vasil Dimov
2023-12-14 14:34:08 +01:00
parent 94aaa5d31b
commit 01dad4efe2
9 changed files with 30 additions and 2 deletions

View File

@@ -1876,6 +1876,7 @@ bool CConnman::AddConnection(const std::string& address, ConnectionType conn_typ
switch (conn_type) {
case ConnectionType::INBOUND:
case ConnectionType::MANUAL:
case ConnectionType::PRIVATE_BROADCAST:
return false;
case ConnectionType::OUTBOUND_FULL_RELAY:
max_connections = m_max_outbound_full_relay;
@@ -2666,6 +2667,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect, std
// peers from addrman.
case ConnectionType::ADDR_FETCH:
case ConnectionType::FEELER:
case ConnectionType::PRIVATE_BROADCAST:
break;
case ConnectionType::MANUAL:
case ConnectionType::OUTBOUND_FULL_RELAY: