mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
Replace CountSecondsDouble with Ticks<SecondsDouble>
This commit is contained in:
@@ -3015,7 +3015,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
||||
if (peer->m_addr_token_bucket < MAX_ADDR_PROCESSING_TOKEN_BUCKET) {
|
||||
// Don't increment bucket if it's already full
|
||||
const auto time_diff = std::max(current_time - peer->m_addr_token_timestamp, 0us);
|
||||
const double increment = CountSecondsDouble(time_diff) * MAX_ADDR_RATE_PER_SECOND;
|
||||
const double increment = Ticks<SecondsDouble>(time_diff) * MAX_ADDR_RATE_PER_SECOND;
|
||||
peer->m_addr_token_bucket = std::min<double>(peer->m_addr_token_bucket + increment, MAX_ADDR_PROCESSING_TOKEN_BUCKET);
|
||||
}
|
||||
peer->m_addr_token_timestamp = current_time;
|
||||
|
||||
Reference in New Issue
Block a user