99
1010//! Service implementation for LSPS5 webhook registration.
1111
12+ use crate :: alloc:: string:: ToString ;
1213use crate :: events:: EventQueue ;
1314use crate :: lsps0:: ser:: { LSPSDateTime , LSPSProtocolMessageHandler , LSPSRequestId } ;
1415use crate :: lsps5:: msgs:: {
@@ -17,17 +18,18 @@ use crate::lsps5::msgs::{
1718} ;
1819use crate :: message_queue:: MessageQueue ;
1920use crate :: prelude:: * ;
20- use core:: ops:: Deref ;
21- use core:: time:: Duration ;
21+ use crate :: sync:: { Arc , Mutex } ;
2222
2323use bitcoin:: secp256k1:: { PublicKey , SecretKey } ;
24+
2425use lightning:: ln:: channelmanager:: AChannelManager ;
2526use lightning:: ln:: msgs:: { ErrorAction , LightningError } ;
2627use lightning:: util:: logger:: Level ;
2728use lightning:: util:: message_signing;
2829
29- use crate :: alloc:: string:: ToString ;
30- use crate :: sync:: { Arc , Mutex } ;
30+ use core:: ops:: Deref ;
31+ use core:: time:: Duration ;
32+
3133use alloc:: string:: String ;
3234use alloc:: vec:: Vec ;
3335
@@ -100,7 +102,7 @@ pub struct LSPS5ServiceConfig {
100102/// - `lsps5.remove_webhook` → delete a named webhook or return [`app_name_not_found`]
101103/// error, emitting [`LSPS5ServiceEvent::WebhookRemoved`].
102104/// - Prune stale webhooks after a client has no open channels and no activity for at least
103- /// [`MIN_WEBHOOK_RETENTION_DAYS`].
105+ /// [`MIN_WEBHOOK_RETENTION_DAYS`].
104106/// - Rate-limit repeat notifications of the same method to a client by
105107/// [`notification_cooldown_hours`].
106108/// - Sign and enqueue outgoing webhook notifications:
@@ -518,11 +520,7 @@ where
518520 self . handle_set_webhook ( * counterparty_node_id, request_id. clone ( ) , params)
519521 } ,
520522 LSPS5Request :: ListWebhooks ( params) => {
521- self . handle_list_webhooks (
522- * counterparty_node_id,
523- request_id. clone ( ) ,
524- params
525- )
523+ self . handle_list_webhooks ( * counterparty_node_id, request_id. clone ( ) , params)
526524 } ,
527525 LSPS5Request :: RemoveWebhook ( params) => self . handle_remove_webhook (
528526 * counterparty_node_id,
@@ -537,8 +535,11 @@ where
537535 false ,
538536 "Service handler received LSPS5 response message. This should never happen."
539537 ) ;
540- let err = format ! ( "Service handler received LSPS5 response message from node {:?}.
541- This should never happen." , counterparty_node_id) ;
538+ let err = format ! (
539+ "Service handler received LSPS5 response message from node {:?}.
540+ This should never happen." ,
541+ counterparty_node_id
542+ ) ;
542543 Err ( LightningError { err, action : ErrorAction :: IgnoreAndLog ( Level :: Info ) } )
543544 } ,
544545 }
0 commit comments