This repository was archived by the owner on Jan 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 80
80
}
81
81
}
82
82
83
+ /// List the LSP protocols a node supports
84
+ ///
85
+ /// Will receive the response via a ListProtocols event
86
+ pub fn list_protocols ( & self , counterparty_node_id : PublicKey ) {
87
+ self . lsps0_message_handler . list_protocols ( counterparty_node_id)
88
+ }
89
+
83
90
/// Needs to be polled regularly to surface events generated by the various protocols
84
91
pub fn get_and_clear_pending_events ( & self ) -> Vec < Event > {
85
92
self . pending_events . lock ( ) . unwrap ( ) . drain ( ..) . collect ( )
Original file line number Diff line number Diff line change @@ -40,17 +40,13 @@ where
40
40
RequestId ( utils:: hex_str ( & bytes[ 0 ..16 ] ) )
41
41
}
42
42
43
- pub fn list_protocols (
44
- & self , counterparty_node_id : PublicKey ,
45
- ) -> Result < ( ) , lightning:: ln:: msgs:: LightningError > {
43
+ pub fn list_protocols ( & self , counterparty_node_id : PublicKey ) {
46
44
let msg = LSPS0Message :: Request (
47
45
self . generate_request_id ( ) ,
48
46
LSPS0Request :: ListProtocols ( ListProtocolsRequest { } ) ,
49
47
) ;
50
48
51
49
self . enqueue_message ( counterparty_node_id, msg) ;
52
-
53
- Ok ( ( ) )
54
50
}
55
51
56
52
fn enqueue_message ( & self , counterparty_node_id : PublicKey , message : LSPS0Message ) {
@@ -195,7 +191,7 @@ mod tests {
195
191
)
196
192
. unwrap ( ) ;
197
193
198
- lsps0_handler. list_protocols ( counterparty_node_id) . unwrap ( ) ;
194
+ lsps0_handler. list_protocols ( counterparty_node_id) ;
199
195
let pending_messages = pending_messages. lock ( ) . unwrap ( ) ;
200
196
201
197
assert_eq ! ( pending_messages. len( ) , 1 ) ;
You can’t perform that action at this time.
0 commit comments