mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-04 21:04:58 +02:00
log: make m_limiter a shared_ptr
This allows us to safely and explicitly manage the dual dependency on the limiter: one for the Logger, and one for the CScheduler.
This commit is contained in:
committed by
Eugene Siegel
parent
e8f9c37a3b
commit
3d630c2544
@@ -1381,7 +1381,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
}
|
||||
}, std::chrono::minutes{5});
|
||||
|
||||
LogInstance().SetRateLimiting(std::make_unique<BCLog::LogRateLimiter>(
|
||||
LogInstance().SetRateLimiting(BCLog::LogRateLimiter::Create(
|
||||
[&scheduler](auto func, auto window) { scheduler.scheduleEvery(std::move(func), window); },
|
||||
BCLog::RATELIMIT_MAX_BYTES,
|
||||
BCLog::RATELIMIT_WINDOW));
|
||||
|
||||
Reference in New Issue
Block a user