@@ -1878,8 +1878,8 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
18781878 auto start = GetTime<std::chrono::microseconds>();
18791879
18801880 // 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);
18831883 const bool dnsseed = gArgs .GetBoolArg (" -dnsseed" , DEFAULT_DNSSEED);
18841884 bool add_fixed_seeds = gArgs .GetBoolArg (" -fixedseeds" , DEFAULT_FIXEDSEEDS);
18851885
@@ -1999,7 +1999,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
19991999 //
20002000 // This is similar to the logic for trying extra outbound (full-relay)
20012001 // 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
20032003 // our tip is stale
20042004 // - we potentially disconnect our next-youngest block-relay-only peer, if our
20052005 // newest block-relay-only peer delivers a block more recently.
@@ -2008,10 +2008,10 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
20082008 // Because we can promote these connections to block-relay-only
20092009 // connections, they do not get their own ConnectionType enum
20102010 // (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);
20122012 conn_type = ConnectionType::BLOCK_RELAY;
20132013 } else if (now > next_feeler) {
2014- next_feeler = PoissonNextSend (now, FEELER_INTERVAL);
2014+ next_feeler = GetExponentialRand (now, FEELER_INTERVAL);
20152015 conn_type = ConnectionType::FEELER;
20162016 fFeeler = true ;
20172017 } else {
@@ -3064,7 +3064,7 @@ std::chrono::microseconds CConnman::PoissonNextSendInbound(std::chrono::microsec
30643064 // If this function were called from multiple threads simultaneously
30653065 // it would possible that both update the next send variable, and return a different result to their caller.
30663066 // 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);
30683068 }
30693069 return m_next_send_inv_to_incoming;
30703070}
0 commit comments