@@ -68,8 +68,8 @@ pub struct LSPS5ServiceConfig {
6868
6969/// Default maximum number of webhooks allowed per client.
7070pub const DEFAULT_MAX_WEBHOOKS_PER_CLIENT : u32 = 10 ;
71- /// Default notification cooldown time in hours .
72- pub const DEFAULT_NOTIFICATION_COOLDOWN_HOURS : Duration = Duration :: from_secs ( 60 * 60 ) ; // 1 hour
71+ /// Default notification cooldown time in minutes .
72+ pub const NOTIFICATION_COOLDOWN_TIME : Duration = Duration :: from_secs ( 60 ) ; // 1 minute
7373
7474// Default configuration for LSPS5 service.
7575impl Default for LSPS5ServiceConfig {
@@ -330,13 +330,13 @@ where
330330 /// node key, and enqueues HTTP POSTs to all registered webhook URLs for that client.
331331 ///
332332 /// This may fail if a similar notification was sent too recently,
333- /// violating the notification cooldown period defined in [`DEFAULT_NOTIFICATION_COOLDOWN_HOURS `].
333+ /// violating the notification cooldown period defined in [`NOTIFICATION_COOLDOWN_TIME `].
334334 ///
335335 /// # Parameters
336336 /// - `client_id`: the client's node-ID whose webhooks should be invoked.
337337 ///
338338 /// [`WebhookNotificationMethod::LSPS5PaymentIncoming`]: super::msgs::WebhookNotificationMethod::LSPS5PaymentIncoming
339- /// [`DEFAULT_NOTIFICATION_COOLDOWN_HOURS `]: super::service::DEFAULT_NOTIFICATION_COOLDOWN_HOURS
339+ /// [`NOTIFICATION_COOLDOWN_TIME `]: super::service::NOTIFICATION_COOLDOWN_TIME
340340 pub fn notify_payment_incoming ( & self , client_id : PublicKey ) -> Result < ( ) , LSPS5ProtocolError > {
341341 let notification = WebhookNotification :: payment_incoming ( ) ;
342342 self . send_notifications_to_client_webhooks ( client_id, notification)
@@ -351,14 +351,14 @@ where
351351 /// registered webhooks.
352352 ///
353353 /// This may fail if a similar notification was sent too recently,
354- /// violating the notification cooldown period defined in [`DEFAULT_NOTIFICATION_COOLDOWN_HOURS `].
354+ /// violating the notification cooldown period defined in [`NOTIFICATION_COOLDOWN_TIME `].
355355 ///
356356 /// # Parameters
357357 /// - `client_id`: the client's node-ID whose webhooks should be invoked.
358358 /// - `timeout`: the block height at which the channel contract will expire.
359359 ///
360360 /// [`WebhookNotificationMethod::LSPS5ExpirySoon`]: super::msgs::WebhookNotificationMethod::LSPS5ExpirySoon
361- /// [`DEFAULT_NOTIFICATION_COOLDOWN_HOURS `]: super::service::DEFAULT_NOTIFICATION_COOLDOWN_HOURS
361+ /// [`NOTIFICATION_COOLDOWN_TIME `]: super::service::NOTIFICATION_COOLDOWN_TIME
362362 pub fn notify_expiry_soon (
363363 & self , client_id : PublicKey , timeout : u32 ,
364364 ) -> Result < ( ) , LSPS5ProtocolError > {
@@ -373,13 +373,13 @@ where
373373 /// signs it, and sends it to all of the client's registered webhook URLs.
374374 ///
375375 /// This may fail if a similar notification was sent too recently,
376- /// violating the notification cooldown period defined in [`DEFAULT_NOTIFICATION_COOLDOWN_HOURS `].
376+ /// violating the notification cooldown period defined in [`NOTIFICATION_COOLDOWN_TIME `].
377377 ///
378378 /// # Parameters
379379 /// - `client_id`: the client's node-ID whose webhooks should be invoked.
380380 ///
381381 /// [`WebhookNotificationMethod::LSPS5LiquidityManagementRequest`]: super::msgs::WebhookNotificationMethod::LSPS5LiquidityManagementRequest
382- /// [`DEFAULT_NOTIFICATION_COOLDOWN_HOURS `]: super::service::DEFAULT_NOTIFICATION_COOLDOWN_HOURS
382+ /// [`NOTIFICATION_COOLDOWN_TIME `]: super::service::NOTIFICATION_COOLDOWN_TIME
383383 pub fn notify_liquidity_management_request (
384384 & self , client_id : PublicKey ,
385385 ) -> Result < ( ) , LSPS5ProtocolError > {
@@ -394,13 +394,13 @@ where
394394 /// notification, signs it, and enqueues HTTP POSTs to each registered webhook.
395395 ///
396396 /// This may fail if a similar notification was sent too recently,
397- /// violating the notification cooldown period defined in [`DEFAULT_NOTIFICATION_COOLDOWN_HOURS `].
397+ /// violating the notification cooldown period defined in [`NOTIFICATION_COOLDOWN_TIME `].
398398 ///
399399 /// # Parameters
400400 /// - `client_id`: the client's node-ID whose webhooks should be invoked.
401401 ///
402402 /// [`WebhookNotificationMethod::LSPS5OnionMessageIncoming`]: super::msgs::WebhookNotificationMethod::LSPS5OnionMessageIncoming
403- /// [`DEFAULT_NOTIFICATION_COOLDOWN_HOURS `]: super::service::DEFAULT_NOTIFICATION_COOLDOWN_HOURS
403+ /// [`NOTIFICATION_COOLDOWN_TIME `]: super::service::NOTIFICATION_COOLDOWN_TIME
404404 pub fn notify_onion_message_incoming (
405405 & self , client_id : PublicKey ,
406406 ) -> Result < ( ) , LSPS5ProtocolError > {
@@ -429,7 +429,7 @@ where
429429 . last_notification_sent
430430 . get ( & notification. method )
431431 . map ( |last_sent| now. duration_since ( & last_sent) )
432- . map_or ( false , |duration| duration < DEFAULT_NOTIFICATION_COOLDOWN_HOURS )
432+ . map_or ( false , |duration| duration < NOTIFICATION_COOLDOWN_TIME )
433433 } ) ;
434434
435435 if rate_limit_applies {
0 commit comments