![]() |
Bitcoin Core 31.1.0
P2P Digital Currency
|
Group of private broadcast related members. More...
#include <net.h>
Public Member Functions | |
| std::optional< Network > | PickNetwork (std::optional< Proxy > &proxy) const |
| Choose a network to open a connection to. | |
| size_t | NumToOpen () const |
| Get the pending number of connections to open. | |
| void | NumToOpenAdd (size_t n) |
| Increment the number of new connections of type ConnectionType::PRIVATE_BROADCAST to be opened by CConnman::ThreadPrivateBroadcast(). | |
| size_t | NumToOpenSub (size_t n) |
| Decrement the number of new connections of type ConnectionType::PRIVATE_BROADCAST to be opened by CConnman::ThreadPrivateBroadcast(). | |
| void | NumToOpenWait () const |
| Wait for the number of needed connections to become greater than 0. | |
Public Attributes | |
| std::atomic_bool | m_outbound_tor_ok_at_least_once {false} |
| Remember if we ever established at least one outbound connection to a Tor peer, including sending and receiving P2P messages. | |
| std::counting_semaphore | m_sem_conn_max {MAX_PRIVATE_BROADCAST_CONNECTIONS} |
| Semaphore used to guard against opening too many connections. | |
Protected Member Functions | |
| std::optional< Proxy > | ProxyForIPv4or6 () const |
| Check if private broadcast can be done to IPv4 or IPv6 peers and if so via which proxy. | |
Protected Attributes | |
| std::atomic_size_t | m_num_to_open {0} |
| Number of ConnectionType::PRIVATE_BROADCAST connections to open. | |
Friends | |
| struct | ConnmanTestMsg |
| size_t CConnman::PrivateBroadcast::NumToOpen | ( | ) | const |
| void CConnman::PrivateBroadcast::NumToOpenAdd | ( | size_t | n | ) |
Increment the number of new connections of type ConnectionType::PRIVATE_BROADCAST to be opened by CConnman::ThreadPrivateBroadcast().
| [in] | n | Increment by this number. |
| size_t CConnman::PrivateBroadcast::NumToOpenSub | ( | size_t | n | ) |
Decrement the number of new connections of type ConnectionType::PRIVATE_BROADCAST to be opened by CConnman::ThreadPrivateBroadcast().
| [in] | n | Decrement by this number. |
| void CConnman::PrivateBroadcast::NumToOpenWait | ( | ) | const |
| std::optional< Network > CConnman::PrivateBroadcast::PickNetwork | ( | std::optional< Proxy > & | proxy | ) | const |
Choose a network to open a connection to.
| [out] | proxy | Optional proxy to override the normal proxy selection. Will be set if !std::nullopt is returned. Could be set to std::nullopt if there is no need to override the proxy that would be used for connecting to the returned network. |
| std::nullopt | No network could be selected. |
| !std::nullopt | The network was selected and proxy is set (maybe to std::nullopt). |
Definition at line 3087 of file net.cpp.
|
protected |
Check if private broadcast can be done to IPv4 or IPv6 peers and if so via which proxy.
If private broadcast connections should not be opened to IPv4 or IPv6, then this will return an empty optional.
Definition at line 3146 of file net.cpp.
|
friend |
|
protected |
Number of ConnectionType::PRIVATE_BROADCAST connections to open.
| std::atomic_bool CConnman::PrivateBroadcast::m_outbound_tor_ok_at_least_once {false} |
Remember if we ever established at least one outbound connection to a Tor peer, including sending and receiving P2P messages.
If this is true then the Tor proxy indeed works and is a proxy to the Tor network, not a misconfigured ordinary SOCKS5 proxy as -proxy or -onion. If that is the case, then we assume that connecting to an IPv4 or IPv6 address via that proxy will be done through the Tor network and a Tor exit node.
| std::counting_semaphore CConnman::PrivateBroadcast::m_sem_conn_max {MAX_PRIVATE_BROADCAST_CONNECTIONS} |