mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 2364d17a31 into merged_master (Bitcoin PR bitcoin/bitcoin#25480)
This commit is contained in:
commit
438cb545b7
7 changed files with 12 additions and 20 deletions
|
|
@ -3070,7 +3070,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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue