@@ -106,7 +106,7 @@ pub(crate) fn poll_for_user_input(
106
106
Err ( e) => {
107
107
println ! ( "{:?}" , e. into_inner( ) . unwrap( ) ) ;
108
108
continue ;
109
- }
109
+ } ,
110
110
} ;
111
111
112
112
let chan_amt_sat: Result < u64 , _ > = channel_value_sat. unwrap ( ) . parse ( ) ;
@@ -136,7 +136,7 @@ pub(crate) fn poll_for_user_input(
136
136
_ => {
137
137
println ! ( "ERROR: invalid boolean flag format. Valid formats: `--option`, `--option=true` `--option=false`" ) ;
138
138
continue ;
139
- }
139
+ } ,
140
140
}
141
141
}
142
142
@@ -155,7 +155,7 @@ pub(crate) fn poll_for_user_input(
155
155
peer_pubkey_and_ip_addr,
156
156
) ;
157
157
}
158
- }
158
+ } ,
159
159
"sendpayment" => {
160
160
let invoice_str = words. next ( ) ;
161
161
if invoice_str. is_none ( ) {
@@ -170,7 +170,7 @@ pub(crate) fn poll_for_user_input(
170
170
Err ( e) => {
171
171
println ! ( "ERROR: couldn't parse amount_msat: {}" , e) ;
172
172
continue ;
173
- }
173
+ } ,
174
174
} ;
175
175
}
176
176
@@ -184,7 +184,7 @@ pub(crate) fn poll_for_user_input(
184
184
( amt, _) => {
185
185
println ! ( "ERROR: Cannot process non-Bitcoin-denominated offer value {:?}" , amt) ;
186
186
continue ;
187
- }
187
+ } ,
188
188
} ;
189
189
if user_provided_amt. is_some ( ) && user_provided_amt != Some ( amt_msat) {
190
190
println ! ( "Amount didn't match offer of {}msat" , amt_msat) ;
@@ -244,37 +244,37 @@ pub(crate) fn poll_for_user_input(
244
244
) ,
245
245
Err ( e) => {
246
246
println ! ( "ERROR: invalid invoice: {:?}" , e) ;
247
- }
247
+ } ,
248
248
}
249
249
}
250
- }
250
+ } ,
251
251
"keysend" => {
252
252
let dest_pubkey = match words. next ( ) {
253
253
Some ( dest) => match hex_utils:: to_compressed_pubkey ( dest) {
254
254
Some ( pk) => pk,
255
255
None => {
256
256
println ! ( "ERROR: couldn't parse destination pubkey" ) ;
257
257
continue ;
258
- }
258
+ } ,
259
259
} ,
260
260
None => {
261
261
println ! ( "ERROR: keysend requires a destination pubkey: `keysend <dest_pubkey> <amt_msat>`" ) ;
262
262
continue ;
263
- }
263
+ } ,
264
264
} ;
265
265
let amt_msat_str = match words. next ( ) {
266
266
Some ( amt) => amt,
267
267
None => {
268
268
println ! ( "ERROR: keysend requires an amount in millisatoshis: `keysend <dest_pubkey> <amt_msat>`" ) ;
269
269
continue ;
270
- }
270
+ } ,
271
271
} ;
272
272
let amt_msat: u64 = match amt_msat_str. parse ( ) {
273
273
Ok ( amt) => amt,
274
274
Err ( e) => {
275
275
println ! ( "ERROR: couldn't parse amount_msat: {}" , e) ;
276
276
continue ;
277
- }
277
+ } ,
278
278
} ;
279
279
keysend (
280
280
& channel_manager,
@@ -284,7 +284,7 @@ pub(crate) fn poll_for_user_input(
284
284
& mut outbound_payments. lock ( ) . unwrap ( ) ,
285
285
Arc :: clone ( & fs_store) ,
286
286
) ;
287
- }
287
+ } ,
288
288
"getoffer" => {
289
289
let offer_builder = channel_manager. create_offer_builder ( String :: new ( ) ) ;
290
290
if let Err ( e) = offer_builder {
@@ -312,7 +312,7 @@ pub(crate) fn poll_for_user_input(
312
312
// correspond with individual payments.
313
313
println ! ( "{}" , offer. unwrap( ) ) ;
314
314
}
315
- }
315
+ } ,
316
316
"getinvoice" => {
317
317
let amt_str = words. next ( ) ;
318
318
if amt_str. is_none ( ) {
@@ -351,7 +351,7 @@ pub(crate) fn poll_for_user_input(
351
351
fs_store
352
352
. write ( "" , "" , INBOUND_PAYMENTS_FNAME , & inbound_payments. encode ( ) )
353
353
. unwrap ( ) ;
354
- }
354
+ } ,
355
355
"connectpeer" => {
356
356
let peer_pubkey_and_ip_addr = words. next ( ) ;
357
357
if peer_pubkey_and_ip_addr. is_none ( ) {
@@ -364,7 +364,7 @@ pub(crate) fn poll_for_user_input(
364
364
Err ( e) => {
365
365
println ! ( "{:?}" , e. into_inner( ) . unwrap( ) ) ;
366
366
continue ;
367
- }
367
+ } ,
368
368
} ;
369
369
if tokio:: runtime:: Handle :: current ( )
370
370
. block_on ( connect_peer_if_necessary (
@@ -376,7 +376,7 @@ pub(crate) fn poll_for_user_input(
376
376
{
377
377
println ! ( "SUCCESS: connected to peer {}" , pubkey) ;
378
378
}
379
- }
379
+ } ,
380
380
"disconnectpeer" => {
381
381
let peer_pubkey = words. next ( ) ;
382
382
if peer_pubkey. is_none ( ) {
@@ -390,7 +390,7 @@ pub(crate) fn poll_for_user_input(
390
390
Err ( e) => {
391
391
println ! ( "ERROR: {}" , e. to_string( ) ) ;
392
392
continue ;
393
- }
393
+ } ,
394
394
} ;
395
395
396
396
if do_disconnect_peer (
@@ -402,7 +402,7 @@ pub(crate) fn poll_for_user_input(
402
402
{
403
403
println ! ( "SUCCESS: disconnected from peer {}" , peer_pubkey) ;
404
404
}
405
- }
405
+ } ,
406
406
"listchannels" => list_channels ( & channel_manager, & network_graph) ,
407
407
"listpayments" => list_payments (
408
408
& inbound_payments. lock ( ) . unwrap ( ) ,
@@ -432,18 +432,18 @@ pub(crate) fn poll_for_user_input(
432
432
None => {
433
433
println ! ( "ERROR: couldn't parse peer_pubkey" ) ;
434
434
continue ;
435
- }
435
+ } ,
436
436
} ;
437
437
let peer_pubkey = match PublicKey :: from_slice ( & peer_pubkey_vec) {
438
438
Ok ( peer_pubkey) => peer_pubkey,
439
439
Err ( _) => {
440
440
println ! ( "ERROR: couldn't parse peer_pubkey" ) ;
441
441
continue ;
442
- }
442
+ } ,
443
443
} ;
444
444
445
445
close_channel ( channel_id, peer_pubkey, channel_manager. clone ( ) ) ;
446
- }
446
+ } ,
447
447
"forceclosechannel" => {
448
448
let channel_id_str = words. next ( ) ;
449
449
if channel_id_str. is_none ( ) {
@@ -468,18 +468,18 @@ pub(crate) fn poll_for_user_input(
468
468
None => {
469
469
println ! ( "ERROR: couldn't parse peer_pubkey" ) ;
470
470
continue ;
471
- }
471
+ } ,
472
472
} ;
473
473
let peer_pubkey = match PublicKey :: from_slice ( & peer_pubkey_vec) {
474
474
Ok ( peer_pubkey) => peer_pubkey,
475
475
Err ( _) => {
476
476
println ! ( "ERROR: couldn't parse peer_pubkey" ) ;
477
477
continue ;
478
- }
478
+ } ,
479
479
} ;
480
480
481
481
force_close_channel ( channel_id, peer_pubkey, channel_manager. clone ( ) ) ;
482
- }
482
+ } ,
483
483
"nodeinfo" => node_info ( & channel_manager, & peer_manager) ,
484
484
"listpeers" => list_peers ( peer_manager. clone ( ) ) ,
485
485
"signmessage" => {
@@ -495,7 +495,7 @@ pub(crate) fn poll_for_user_input(
495
495
& keys_manager. get_node_secret_key( )
496
496
)
497
497
) ;
498
- }
498
+ } ,
499
499
"sendonionmessage" => {
500
500
let path_pks_str = words. next ( ) ;
501
501
if path_pks_str. is_none ( ) {
@@ -513,15 +513,15 @@ pub(crate) fn poll_for_user_input(
513
513
println ! ( "ERROR: couldn't parse peer_pubkey" ) ;
514
514
errored = true ;
515
515
break ;
516
- }
516
+ } ,
517
517
} ;
518
518
let node_pubkey = match PublicKey :: from_slice ( & node_pubkey_vec) {
519
519
Ok ( peer_pubkey) => peer_pubkey,
520
520
Err ( _) => {
521
521
println ! ( "ERROR: couldn't parse peer_pubkey" ) ;
522
522
errored = true ;
523
523
break ;
524
- }
524
+ } ,
525
525
} ;
526
526
intermediate_nodes. push ( node_pubkey) ;
527
527
}
@@ -533,14 +533,14 @@ pub(crate) fn poll_for_user_input(
533
533
_ => {
534
534
println ! ( "Need an integral message type above 64" ) ;
535
535
continue ;
536
- }
536
+ } ,
537
537
} ;
538
538
let data = match words. next ( ) . map ( |s| hex_utils:: to_vec ( s) ) {
539
539
Some ( Some ( data) ) => data,
540
540
_ => {
541
541
println ! ( "Need a hex data string" ) ;
542
542
continue ;
543
- }
543
+ } ,
544
544
} ;
545
545
let destination = Destination :: Node ( intermediate_nodes. pop ( ) . unwrap ( ) ) ;
546
546
match onion_messenger. send_onion_message (
@@ -550,10 +550,10 @@ pub(crate) fn poll_for_user_input(
550
550
) {
551
551
Ok ( success) => {
552
552
println ! ( "SUCCESS: forwarded onion message to first hop {:?}" , success)
553
- }
553
+ } ,
554
554
Err ( e) => println ! ( "ERROR: failed to send onion message: {:?}" , e) ,
555
555
}
556
- }
556
+ } ,
557
557
"quit" | "exit" => break ,
558
558
_ => println ! ( "Unknown command. See `\" help\" for available commands." ) ,
559
559
}
@@ -729,7 +729,7 @@ pub(crate) async fn do_connect_peer(
729
729
return Ok ( ( ) ) ;
730
730
}
731
731
}
732
- }
732
+ } ,
733
733
None => Err ( ( ) ) ,
734
734
}
735
735
}
@@ -779,11 +779,11 @@ fn open_channel(
779
779
Ok ( _) => {
780
780
println ! ( "EVENT: initiated channel with peer {}. " , peer_pubkey) ;
781
781
return Ok ( ( ) ) ;
782
- }
782
+ } ,
783
783
Err ( e) => {
784
784
println ! ( "ERROR: failed to open channel: {:?}" , e) ;
785
785
return Err ( ( ) ) ;
786
- }
786
+ } ,
787
787
}
788
788
}
789
789
@@ -821,7 +821,7 @@ fn send_payment(
821
821
println ! ( "Failed to parse invoice: {:?}" , e) ;
822
822
print ! ( "> " ) ;
823
823
return ;
824
- }
824
+ } ,
825
825
} ;
826
826
outbound_payments. payments . insert (
827
827
payment_id,
@@ -846,13 +846,13 @@ fn send_payment(
846
846
let amt_msat = invoice. amount_milli_satoshis ( ) . unwrap ( ) ;
847
847
println ! ( "EVENT: initiated sending {} msats to {}" , amt_msat, payee_pubkey) ;
848
848
print ! ( "> " ) ;
849
- }
849
+ } ,
850
850
Err ( e) => {
851
851
println ! ( "ERROR: failed to send payment: {:?}" , e) ;
852
852
print ! ( "> " ) ;
853
853
outbound_payments. payments . get_mut ( & payment_id) . unwrap ( ) . status = HTLCStatus :: Failed ;
854
854
fs_store. write ( "" , "" , OUTBOUND_PAYMENTS_FNAME , & outbound_payments. encode ( ) ) . unwrap ( ) ;
855
- }
855
+ } ,
856
856
} ;
857
857
}
858
858
@@ -887,13 +887,13 @@ fn keysend<E: EntropySource>(
887
887
Ok ( _payment_hash) => {
888
888
println ! ( "EVENT: initiated sending {} msats to {}" , amt_msat, payee_pubkey) ;
889
889
print ! ( "> " ) ;
890
- }
890
+ } ,
891
891
Err ( e) => {
892
892
println ! ( "ERROR: failed to send payment: {:?}" , e) ;
893
893
print ! ( "> " ) ;
894
894
outbound_payments. payments . get_mut ( & payment_id) . unwrap ( ) . status = HTLCStatus :: Failed ;
895
895
fs_store. write ( "" , "" , OUTBOUND_PAYMENTS_FNAME , & outbound_payments. encode ( ) ) . unwrap ( ) ;
896
- }
896
+ } ,
897
897
} ;
898
898
}
899
899
@@ -921,11 +921,11 @@ fn get_invoice(
921
921
Ok ( inv) => {
922
922
println ! ( "SUCCESS: generated invoice: {}" , inv) ;
923
923
inv
924
- }
924
+ } ,
925
925
Err ( e) => {
926
926
println ! ( "ERROR: failed to create invoice: {:?}" , e) ;
927
927
return ;
928
- }
928
+ } ,
929
929
} ;
930
930
931
931
let payment_hash = PaymentHash ( invoice. payment_hash ( ) . to_byte_array ( ) ) ;
0 commit comments