Skip to content

Commit 839b77b

Browse files
fixup: avoid unnecesary multipliation in cooldown_duration. thanks graphite
1 parent 2405459 commit 839b77b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lightning-liquidity/src/lsps5/service.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,15 +406,15 @@ where
406406

407407
let now =
408408
LSPSDateTime::new_from_duration_since_epoch(self.time_provider.duration_since_epoch());
409-
let cooldown_duration = self.config.notification_cooldown_hours * 3600;
410409

411410
for (app_name, webhook) in client_webhooks.iter_mut() {
412411
if webhook
413412
.last_notification_sent
414413
.get(&notification.method)
415414
.map(|last_sent| now.clone().abs_diff(&last_sent))
416-
.map_or(true, |duration| duration >= cooldown_duration.as_secs())
417-
{
415+
.map_or(true, |duration| {
416+
duration >= self.config.notification_cooldown_hours.as_secs()
417+
}) {
418418
webhook.last_notification_sent.insert(notification.method.clone(), now.clone());
419419
webhook.last_used = now.clone();
420420
self.send_notification(

0 commit comments

Comments
 (0)