Changeset View
Changeset View
Standalone View
Standalone View
src/net.h
Show First 20 Lines • Show All 291 Lines • ▼ Show 20 Lines | public: | ||||
/** Get a unique deterministic randomizer. */ | /** Get a unique deterministic randomizer. */ | ||||
CSipHasher GetDeterministicRandomizer(uint64_t id) const; | CSipHasher GetDeterministicRandomizer(uint64_t id) const; | ||||
unsigned int GetReceiveFloodSize() const; | unsigned int GetReceiveFloodSize() const; | ||||
void WakeMessageHandler(); | void WakeMessageHandler(); | ||||
/** | |||||
* Attempts to obfuscate tx time through exponentially distributed emitting. | |||||
* Works assuming that a single interval is used. | |||||
* Variable intervals will result in privacy decrease. | |||||
*/ | |||||
int64_t PoissonNextSendInbound(int64_t now, int average_interval_seconds); | |||||
private: | private: | ||||
struct ListenSocket { | struct ListenSocket { | ||||
SOCKET socket; | SOCKET socket; | ||||
bool whitelisted; | bool whitelisted; | ||||
ListenSocket(SOCKET socket_, bool whitelisted_) | ListenSocket(SOCKET socket_, bool whitelisted_) | ||||
: socket(socket_), whitelisted(whitelisted_) {} | : socket(socket_), whitelisted(whitelisted_) {} | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | private: | ||||
/** | /** | ||||
* Flag for deciding to connect to an extra outbound peer, in excess of | * Flag for deciding to connect to an extra outbound peer, in excess of | ||||
* nMaxOutbound. | * nMaxOutbound. | ||||
* This takes the place of a feeler connection. | * This takes the place of a feeler connection. | ||||
*/ | */ | ||||
std::atomic_bool m_try_another_outbound_peer; | std::atomic_bool m_try_another_outbound_peer; | ||||
std::atomic<int64_t> m_next_send_inv_to_incoming; | |||||
friend struct CConnmanTest; | friend struct CConnmanTest; | ||||
}; | }; | ||||
extern std::unique_ptr<CConnman> g_connman; | extern std::unique_ptr<CConnman> g_connman; | ||||
extern std::unique_ptr<BanMan> g_banman; | extern std::unique_ptr<BanMan> g_banman; | ||||
void Discover(); | void Discover(); | ||||
void StartMapPort(); | void StartMapPort(); | ||||
void InterruptMapPort(); | void InterruptMapPort(); | ||||
▲ Show 20 Lines • Show All 402 Lines • ▼ Show 20 Lines | public: | ||||
//! Sets the addrName only if it was not previously set | //! Sets the addrName only if it was not previously set | ||||
void MaybeSetAddrName(const std::string &addrNameIn); | void MaybeSetAddrName(const std::string &addrNameIn); | ||||
}; | }; | ||||
/** | /** | ||||
* Return a timestamp in the future (in microseconds) for exponentially | * Return a timestamp in the future (in microseconds) for exponentially | ||||
* distributed events. | * distributed events. | ||||
*/ | */ | ||||
int64_t PoissonNextSend(int64_t nNow, int average_interval_seconds); | int64_t PoissonNextSend(int64_t now, int average_interval_seconds); | ||||
std::string getSubVersionEB(uint64_t MaxBlockSize); | std::string getSubVersionEB(uint64_t MaxBlockSize); | ||||
std::string userAgent(const Config &config); | std::string userAgent(const Config &config); | ||||
#endif // BITCOIN_NET_H | #endif // BITCOIN_NET_H |