aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorGleb <naumenko.gs@gmail.com>2018-05-21 12:02:40 -0700
committerUser <naumenko.gs@gmail.com>2018-07-13 23:14:35 -0700
commitd45b344ffd46b0226449cbd46cdaff9577402cf0 (patch)
tree0b23b028d113acce4c57faf3d8f931deba5436d9 /src/net.h
parent287e4edc2fd2514a0095273f01fe66b85ce10856 (diff)
Bucket for inbound when scheduling invs to hide tx time
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/net.h b/src/net.h
index 1bcc3cbb44..e542201163 100644
--- a/src/net.h
+++ b/src/net.h
@@ -310,6 +310,13 @@ public:
unsigned int GetReceiveFloodSize() const;
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:
struct ListenSocket {
SOCKET socket;
@@ -434,6 +441,8 @@ private:
* This takes the place of a feeler connection */
std::atomic_bool m_try_another_outbound_peer;
+ std::atomic<int64_t> m_next_send_inv_to_incoming;
+
friend struct CConnmanTest;
};
extern std::unique_ptr<CConnman> g_connman;
@@ -863,6 +872,6 @@ public:
/** Return a timestamp in the future (in microseconds) for exponentially distributed events. */
-int64_t PoissonNextSend(int64_t nNow, int average_interval_seconds);
+int64_t PoissonNextSend(int64_t now, int average_interval_seconds);
#endif // BITCOIN_NET_H