Skip to content

Commit 9b8dcb2

Browse files
jnewberymzumsande
authored andcommitted
[net processing] Rename PoissonNextSendInbound to NextInvToInbounds
1 parent ea99f5d commit 9b8dcb2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/net_processing.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ class PeerManagerImpl final : public PeerManager
444444
*/
445445
std::map<NodeId, PeerRef> m_peer_map GUARDED_BY(m_peer_mutex);
446446

447-
std::atomic<std::chrono::microseconds> m_next_send_inv_to_incoming{0us};
447+
std::atomic<std::chrono::microseconds> m_next_inv_to_inbounds{0us};
448448

449449
/** Number of nodes with fSyncStarted. */
450450
int nSyncStarted GUARDED_BY(cs_main) = 0;
@@ -526,8 +526,8 @@ class PeerManagerImpl final : public PeerManager
526526
* peer, a spy node could make multiple inbound connections to us to
527527
* accurately determine when we received the transaction (and potentially
528528
* determine the transaction's origin). */
529-
std::chrono::microseconds PoissonNextSendInbound(std::chrono::microseconds now,
530-
std::chrono::seconds average_interval);
529+
std::chrono::microseconds NextInvToInbounds(std::chrono::microseconds now,
530+
std::chrono::seconds average_interval);
531531

532532
/** Have we requested this block from a peer */
533533
bool IsBlockRequested(const uint256& hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
@@ -830,16 +830,16 @@ static void UpdatePreferredDownload(const CNode& node, CNodeState* state) EXCLUS
830830
nPreferredDownload += state->fPreferredDownload;
831831
}
832832

833-
std::chrono::microseconds PeerManagerImpl::PoissonNextSendInbound(std::chrono::microseconds now,
834-
std::chrono::seconds average_interval)
833+
std::chrono::microseconds PeerManagerImpl::NextInvToInbounds(std::chrono::microseconds now,
834+
std::chrono::seconds average_interval)
835835
{
836-
if (m_next_send_inv_to_incoming.load() < now) {
836+
if (m_next_inv_to_inbounds.load() < now) {
837837
// If this function were called from multiple threads simultaneously
838838
// it would possible that both update the next send variable, and return a different result to their caller.
839839
// This is not possible in practice as only the net processing thread invokes this function.
840-
m_next_send_inv_to_incoming = GetExponentialRand(now, average_interval);
840+
m_next_inv_to_inbounds = GetExponentialRand(now, average_interval);
841841
}
842-
return m_next_send_inv_to_incoming;
842+
return m_next_inv_to_inbounds;
843843
}
844844

845845
bool PeerManagerImpl::IsBlockRequested(const uint256& hash)
@@ -4809,7 +4809,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
48094809
if (pto->m_tx_relay->nNextInvSend < current_time) {
48104810
fSendTrickle = true;
48114811
if (pto->IsInboundConn()) {
4812-
pto->m_tx_relay->nNextInvSend = PoissonNextSendInbound(current_time, INBOUND_INVENTORY_BROADCAST_INTERVAL);
4812+
pto->m_tx_relay->nNextInvSend = NextInvToInbounds(current_time, INBOUND_INVENTORY_BROADCAST_INTERVAL);
48134813
} else {
48144814
pto->m_tx_relay->nNextInvSend = GetExponentialRand(current_time, OUTBOUND_INVENTORY_BROADCAST_INTERVAL);
48154815
}

0 commit comments

Comments
 (0)