aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2022-06-28 18:18:06 +0100
committerfanquake <fanquake@gmail.com>2022-06-28 18:18:19 +0100
commit2364d17a31e8ae838ff32327f55cbe84b0e70b34 (patch)
tree7a8efaf98803e81ccce08eb0b6f279aec49eade8 /src/net_processing.cpp
parentbace615ba31cedec50afa4f296934a186b9afae6 (diff)
parentfa956e7508986991008e2f6126ab307924b3f353 (diff)
downloadbitcoin-2364d17a31e8ae838ff32327f55cbe84b0e70b34.tar.xz
Merge bitcoin/bitcoin#25480: Replace CountSecondsDouble with Ticks<SecondsDouble>
fa956e7508986991008e2f6126ab307924b3f353 Replace CountSecondsDouble with Ticks<SecondsDouble> (MacroFake) Pull request description: Seems odd to have two ways to say exactly the same thing when one is sufficient. ACKs for top commit: fanquake: ACK fa956e7508986991008e2f6126ab307924b3f353 shaavan: ACK fa956e7508986991008e2f6126ab307924b3f353 w0xlt: ACK https://github.com/bitcoin/bitcoin/pull/25480/commits/fa956e7508986991008e2f6126ab307924b3f353 Tree-SHA512: b599470e19b693da1ed1102d1e86b08cb03adaddf2048752b6d050fdf86055be117ff0ae10b6953d03e00eaaf7b0cfa350137968b67d6c5b3ca68c5aa50ca6aa
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index a556180721..9b87833391 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -3019,7 +3019,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;