@@ -65,7 +65,7 @@ pub(crate) fn poll_for_user_input(
65
65
keys_manager : Arc < KeysManager > , network_graph : Arc < NetworkGraph > ,
66
66
onion_messenger : Arc < OnionMessenger > , inbound_payments : Arc < Mutex < PaymentInfoStorage > > ,
67
67
outbound_payments : Arc < Mutex < PaymentInfoStorage > > , ldk_data_dir : String , network : Network ,
68
- logger : Arc < disk:: FilesystemLogger > , persister : Arc < FilesystemStore > ,
68
+ logger : Arc < disk:: FilesystemLogger > , fs_store : Arc < FilesystemStore > ,
69
69
) {
70
70
println ! (
71
71
"LDK startup successful. Enter \" help\" to view available commands. Press Ctrl-D to quit."
@@ -172,7 +172,7 @@ pub(crate) fn poll_for_user_input(
172
172
& channel_manager,
173
173
& invoice,
174
174
& mut outbound_payments. lock ( ) . unwrap ( ) ,
175
- persister . clone ( ) ,
175
+ Arc :: clone ( & fs_store ) ,
176
176
) ;
177
177
}
178
178
"keysend" => {
@@ -209,7 +209,7 @@ pub(crate) fn poll_for_user_input(
209
209
amt_msat,
210
210
& * keys_manager,
211
211
& mut outbound_payments. lock ( ) . unwrap ( ) ,
212
- persister . clone ( ) ,
212
+ Arc :: clone ( & fs_store ) ,
213
213
) ;
214
214
}
215
215
"getinvoice" => {
@@ -247,7 +247,7 @@ pub(crate) fn poll_for_user_input(
247
247
expiry_secs. unwrap ( ) ,
248
248
Arc :: clone ( & logger) ,
249
249
) ;
250
- persister
250
+ fs_store
251
251
. write ( "" , "" , INBOUND_PAYMENTS_FNAME , & inbound_payments. encode ( ) )
252
252
. unwrap ( ) ;
253
253
}
@@ -684,7 +684,7 @@ fn open_channel(
684
684
685
685
fn send_payment (
686
686
channel_manager : & ChannelManager , invoice : & Bolt11Invoice ,
687
- outbound_payments : & mut PaymentInfoStorage , persister : Arc < FilesystemStore > ,
687
+ outbound_payments : & mut PaymentInfoStorage , fs_store : Arc < FilesystemStore > ,
688
688
) {
689
689
let payment_hash = PaymentHash ( ( * invoice. payment_hash ( ) ) . into_inner ( ) ) ;
690
690
let payment_secret = Some ( * invoice. payment_secret ( ) ) ;
@@ -697,7 +697,7 @@ fn send_payment(
697
697
amt_msat : MillisatAmount ( invoice. amount_milli_satoshis ( ) ) ,
698
698
} ,
699
699
) ;
700
- persister . write ( "" , "" , OUTBOUND_PAYMENTS_FNAME , & outbound_payments. encode ( ) ) . unwrap ( ) ;
700
+ fs_store . write ( "" , "" , OUTBOUND_PAYMENTS_FNAME , & outbound_payments. encode ( ) ) . unwrap ( ) ;
701
701
match pay_invoice ( invoice, Retry :: Timeout ( Duration :: from_secs ( 10 ) ) , channel_manager) {
702
702
Ok ( _payment_id) => {
703
703
let payee_pubkey = invoice. recover_payee_pub_key ( ) ;
@@ -709,14 +709,14 @@ fn send_payment(
709
709
println ! ( "ERROR: failed to send payment: {:?}" , e) ;
710
710
print ! ( "> " ) ;
711
711
outbound_payments. payments . get_mut ( & payment_hash) . unwrap ( ) . status = HTLCStatus :: Failed ;
712
- persister . write ( "" , "" , OUTBOUND_PAYMENTS_FNAME , & outbound_payments. encode ( ) ) . unwrap ( ) ;
712
+ fs_store . write ( "" , "" , OUTBOUND_PAYMENTS_FNAME , & outbound_payments. encode ( ) ) . unwrap ( ) ;
713
713
}
714
714
} ;
715
715
}
716
716
717
717
fn keysend < E : EntropySource > (
718
718
channel_manager : & ChannelManager , payee_pubkey : PublicKey , amt_msat : u64 , entropy_source : & E ,
719
- outbound_payments : & mut PaymentInfoStorage , persister : Arc < FilesystemStore > ,
719
+ outbound_payments : & mut PaymentInfoStorage , fs_store : Arc < FilesystemStore > ,
720
720
) {
721
721
let payment_preimage = PaymentPreimage ( entropy_source. get_secure_random_bytes ( ) ) ;
722
722
let payment_hash = PaymentHash ( Sha256 :: hash ( & payment_preimage. 0 [ ..] ) . into_inner ( ) ) ;
@@ -734,7 +734,7 @@ fn keysend<E: EntropySource>(
734
734
amt_msat : MillisatAmount ( Some ( amt_msat) ) ,
735
735
} ,
736
736
) ;
737
- persister . write ( "" , "" , OUTBOUND_PAYMENTS_FNAME , & outbound_payments. encode ( ) ) . unwrap ( ) ;
737
+ fs_store . write ( "" , "" , OUTBOUND_PAYMENTS_FNAME , & outbound_payments. encode ( ) ) . unwrap ( ) ;
738
738
match channel_manager. send_spontaneous_payment_with_retry (
739
739
Some ( payment_preimage) ,
740
740
RecipientOnionFields :: spontaneous_empty ( ) ,
@@ -750,7 +750,7 @@ fn keysend<E: EntropySource>(
750
750
println ! ( "ERROR: failed to send payment: {:?}" , e) ;
751
751
print ! ( "> " ) ;
752
752
outbound_payments. payments . get_mut ( & payment_hash) . unwrap ( ) . status = HTLCStatus :: Failed ;
753
- persister . write ( "" , "" , OUTBOUND_PAYMENTS_FNAME , & outbound_payments. encode ( ) ) . unwrap ( ) ;
753
+ fs_store . write ( "" , "" , OUTBOUND_PAYMENTS_FNAME , & outbound_payments. encode ( ) ) . unwrap ( ) ;
754
754
}
755
755
} ;
756
756
}
0 commit comments