@@ -1878,8 +1878,8 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
1878
1878
auto start = GetTime<std::chrono::microseconds>();
1879
1879
1880
1880
// Minimum time before next feeler connection (in microseconds).
1881
- auto next_feeler = PoissonNextSend (start, FEELER_INTERVAL);
1882
- auto next_extra_block_relay = PoissonNextSend (start, EXTRA_BLOCK_RELAY_ONLY_PEER_INTERVAL);
1881
+ auto next_feeler = GetExponentialRand (start, FEELER_INTERVAL);
1882
+ auto next_extra_block_relay = GetExponentialRand (start, EXTRA_BLOCK_RELAY_ONLY_PEER_INTERVAL);
1883
1883
const bool dnsseed = gArgs .GetBoolArg (" -dnsseed" , DEFAULT_DNSSEED);
1884
1884
bool add_fixed_seeds = gArgs .GetBoolArg (" -fixedseeds" , DEFAULT_FIXEDSEEDS);
1885
1885
@@ -1999,7 +1999,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
1999
1999
//
2000
2000
// This is similar to the logic for trying extra outbound (full-relay)
2001
2001
// peers, except:
2002
- // - we do this all the time on a poisson timer, rather than just when
2002
+ // - we do this all the time on an exponential timer, rather than just when
2003
2003
// our tip is stale
2004
2004
// - we potentially disconnect our next-youngest block-relay-only peer, if our
2005
2005
// newest block-relay-only peer delivers a block more recently.
@@ -2008,10 +2008,10 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
2008
2008
// Because we can promote these connections to block-relay-only
2009
2009
// connections, they do not get their own ConnectionType enum
2010
2010
// (similar to how we deal with extra outbound peers).
2011
- next_extra_block_relay = PoissonNextSend (now, EXTRA_BLOCK_RELAY_ONLY_PEER_INTERVAL);
2011
+ next_extra_block_relay = GetExponentialRand (now, EXTRA_BLOCK_RELAY_ONLY_PEER_INTERVAL);
2012
2012
conn_type = ConnectionType::BLOCK_RELAY;
2013
2013
} else if (now > next_feeler) {
2014
- next_feeler = PoissonNextSend (now, FEELER_INTERVAL);
2014
+ next_feeler = GetExponentialRand (now, FEELER_INTERVAL);
2015
2015
conn_type = ConnectionType::FEELER;
2016
2016
fFeeler = true ;
2017
2017
} else {
@@ -3064,7 +3064,7 @@ std::chrono::microseconds CConnman::PoissonNextSendInbound(std::chrono::microsec
3064
3064
// If this function were called from multiple threads simultaneously
3065
3065
// it would possible that both update the next send variable, and return a different result to their caller.
3066
3066
// This is not possible in practice as only the net processing thread invokes this function.
3067
- m_next_send_inv_to_incoming = PoissonNextSend (now, average_interval);
3067
+ m_next_send_inv_to_incoming = GetExponentialRand (now, average_interval);
3068
3068
}
3069
3069
return m_next_send_inv_to_incoming;
3070
3070
}
0 commit comments