@@ -12,8 +12,6 @@ use lightning::ln::channelmanager::{PaymentId, RecipientOnionFields, Retry};
12
12
use lightning:: ln:: msgs:: SocketAddress ;
13
13
use lightning:: ln:: { ChannelId , PaymentHash , PaymentPreimage } ;
14
14
use lightning:: offers:: offer:: { self , Offer } ;
15
- use lightning:: onion_message:: messenger:: Destination ;
16
- use lightning:: onion_message:: packet:: OnionMessageContents ;
17
15
use lightning:: routing:: gossip:: NodeId ;
18
16
use lightning:: routing:: router:: { PaymentParameters , RouteParameters } ;
19
17
use lightning:: sign:: { EntropySource , KeysManager } ;
@@ -45,24 +43,6 @@ pub(crate) struct LdkUserInfo {
45
43
pub ( crate ) network : Network ,
46
44
}
47
45
48
- #[ derive( Debug ) ]
49
- struct UserOnionMessageContents {
50
- tlv_type : u64 ,
51
- data : Vec < u8 > ,
52
- }
53
-
54
- impl OnionMessageContents for UserOnionMessageContents {
55
- fn tlv_type ( & self ) -> u64 {
56
- self . tlv_type
57
- }
58
- }
59
-
60
- impl Writeable for UserOnionMessageContents {
61
- fn write < W : Writer > ( & self , w : & mut W ) -> Result < ( ) , std:: io:: Error > {
62
- w. write_all ( & self . data )
63
- }
64
- }
65
-
66
46
pub ( crate ) fn poll_for_user_input (
67
47
peer_manager : Arc < PeerManager > , channel_manager : Arc < ChannelManager > ,
68
48
keys_manager : Arc < KeysManager > , network_graph : Arc < NetworkGraph > ,
@@ -496,64 +476,6 @@ pub(crate) fn poll_for_user_input(
496
476
)
497
477
) ;
498
478
} ,
499
- "sendonionmessage" => {
500
- let path_pks_str = words. next ( ) ;
501
- if path_pks_str. is_none ( ) {
502
- println ! (
503
- "ERROR: sendonionmessage requires at least one node id for the path"
504
- ) ;
505
- continue ;
506
- }
507
- let mut intermediate_nodes = Vec :: new ( ) ;
508
- let mut errored = false ;
509
- for pk_str in path_pks_str. unwrap ( ) . split ( "," ) {
510
- let node_pubkey_vec = match hex_utils:: to_vec ( pk_str) {
511
- Some ( peer_pubkey_vec) => peer_pubkey_vec,
512
- None => {
513
- println ! ( "ERROR: couldn't parse peer_pubkey" ) ;
514
- errored = true ;
515
- break ;
516
- } ,
517
- } ;
518
- let node_pubkey = match PublicKey :: from_slice ( & node_pubkey_vec) {
519
- Ok ( peer_pubkey) => peer_pubkey,
520
- Err ( _) => {
521
- println ! ( "ERROR: couldn't parse peer_pubkey" ) ;
522
- errored = true ;
523
- break ;
524
- } ,
525
- } ;
526
- intermediate_nodes. push ( node_pubkey) ;
527
- }
528
- if errored {
529
- continue ;
530
- }
531
- let tlv_type = match words. next ( ) . map ( |ty_str| ty_str. parse ( ) ) {
532
- Some ( Ok ( ty) ) if ty >= 64 => ty,
533
- _ => {
534
- println ! ( "Need an integral message type above 64" ) ;
535
- continue ;
536
- } ,
537
- } ;
538
- let data = match words. next ( ) . map ( |s| hex_utils:: to_vec ( s) ) {
539
- Some ( Some ( data) ) => data,
540
- _ => {
541
- println ! ( "Need a hex data string" ) ;
542
- continue ;
543
- } ,
544
- } ;
545
- let destination = Destination :: Node ( intermediate_nodes. pop ( ) . unwrap ( ) ) ;
546
- match onion_messenger. send_onion_message (
547
- UserOnionMessageContents { tlv_type, data } ,
548
- destination,
549
- None ,
550
- ) {
551
- Ok ( success) => {
552
- println ! ( "SUCCESS: forwarded onion message to first hop {:?}" , success)
553
- } ,
554
- Err ( e) => println ! ( "ERROR: failed to send onion message: {:?}" , e) ,
555
- }
556
- } ,
557
479
"quit" | "exit" => break ,
558
480
_ => println ! ( "Unknown command. See `\" help\" for available commands." ) ,
559
481
}
@@ -589,9 +511,6 @@ fn help() {
589
511
println ! ( " getoffer [<amt_msats>]" ) ;
590
512
println ! ( "\n Other:" ) ;
591
513
println ! ( " signmessage <message>" ) ;
592
- println ! (
593
- " sendonionmessage <node_id_1,node_id_2,..,destination_node_id> <type> <hex_bytes>"
594
- ) ;
595
514
println ! ( " nodeinfo" ) ;
596
515
}
597
516
0 commit comments