11use cln_rpc:: {
22 model:: {
3- requests:: {
4- ConnectRequest , GetinfoRequest , GetrouteRequest , ListpeerchannelsRequest ,
5- ListpeersRequest ,
6- } ,
3+ requests:: { ConnectRequest , GetinfoRequest , GetrouteRequest , ListpeerchannelsRequest } ,
74 responses:: GetrouteResponse ,
85 } ,
96 primitives:: { Amount , PublicKey , ShortChannelId } ,
@@ -311,7 +308,6 @@ async fn billboard(
311308 . await
312309 . map_err ( |e| Error :: Rpc ( e) ) ?
313310 . channels
314- . ok_or ( Error :: Channel ( "No channels found" ) ) ?
315311 . into_iter ( )
316312 . filter ( |c| {
317313 c. short_channel_id == Some ( scid)
@@ -324,28 +320,10 @@ async fn billboard(
324320 . status
325321 . ok_or ( Error :: Channel ( "Status not found" ) ) ?)
326322 } else {
327- #[ allow( deprecated) ]
328- Ok ( rpc
329- . call_typed ( & ListpeersRequest {
330- id : Some ( peer_id) ,
331- level : None ,
332- } )
333- . await
334- . map_err ( |e| Error :: Rpc ( e) ) ?
335- . peers
336- . into_iter ( )
337- . nth ( 0 )
338- . ok_or ( Error :: Channel ( "Has no peers list" ) ) ?
339- . channels
340- . into_iter ( )
341- . nth ( 0 )
342- . ok_or ( Error :: Channel ( "Has no channels list" ) ) ?
343- . into_iter ( )
344- . filter ( |c| c. short_channel_id == Some ( scid) )
345- . nth ( 0 )
346- . ok_or ( Error :: Channel ( "No channel with scid" ) ) ?
347- . status
348- . ok_or ( Error :: Channel ( "No amount found" ) ) ?)
323+ return Err ( Error :: Service ( format ! (
324+ "Not supported in this version of core-lightning: {}, need at least v23.05gl1" ,
325+ version,
326+ ) ) ) ;
349327 }
350328}
351329
@@ -381,7 +359,6 @@ async fn spendable_msat(
381359 . await
382360 . map_err ( |e| Error :: Rpc ( e) ) ?
383361 . channels
384- . ok_or ( Error :: Channel ( "No channels found" ) ) ?
385362 . into_iter ( )
386363 . filter ( |c| {
387364 c. short_channel_id == Some ( scid)
@@ -394,28 +371,10 @@ async fn spendable_msat(
394371 . spendable_msat
395372 . ok_or ( Error :: Channel ( "No amount found" ) ) ?)
396373 } else {
397- #[ allow( deprecated) ]
398- Ok ( rpc
399- . call_typed ( & ListpeersRequest {
400- id : Some ( peer_id) ,
401- level : None ,
402- } )
403- . await
404- . map_err ( |e| Error :: Rpc ( e) ) ?
405- . peers
406- . into_iter ( )
407- . nth ( 0 )
408- . ok_or ( Error :: Channel ( "Has no peers list" ) ) ?
409- . channels
410- . into_iter ( )
411- . nth ( 0 )
412- . ok_or ( Error :: Channel ( "Has no channels list" ) ) ?
413- . into_iter ( )
414- . filter ( |c| c. short_channel_id == Some ( scid) )
415- . nth ( 0 )
416- . ok_or ( Error :: Channel ( "No channel with scid" ) ) ?
417- . spendable_msat
418- . ok_or ( Error :: Channel ( "No amount found" ) ) ?)
374+ return Err ( Error :: Service ( format ! (
375+ "Not supported in this version of core-lightning: {}, need at least v23.05gl1" ,
376+ version,
377+ ) ) ) ;
419378 }
420379}
421380
0 commit comments