@@ -16,7 +16,7 @@ use std::sync::Arc;
1616use crate :: error:: APIError ;
1717use crate :: ldk:: {
1818 ChannelIdsMap , InboundPaymentInfoStorage , NetworkGraph , OutboundPaymentInfoStorage ,
19- OutputSpenderTxes , SwapMap ,
19+ OutputSpenderTxes , SwapMap , VirtualChannelDraftStore , VirtualChannelSessionStore ,
2020} ;
2121use crate :: utils:: { parse_peer_info, LOGS_DIR } ;
2222
@@ -30,6 +30,8 @@ pub(crate) const CHANNEL_PEER_DATA: &str = "channel_peer_data";
3030pub ( crate ) const OUTPUT_SPENDER_TXES : & str = "output_spender_txes" ;
3131
3232pub ( crate ) const CHANNEL_IDS_FNAME : & str = "channel_ids" ;
33+ pub ( crate ) const VIRTUAL_CHANNEL_DRAFT_STORE_FNAME : & str = "virtual_channel_drafts" ;
34+ pub ( crate ) const VIRTUAL_CHANNEL_SESSION_STORE_FNAME : & str = "virtual_channel_sessions" ;
3335
3436pub ( crate ) const MAKER_SWAPS_FNAME : & str = "maker_swaps" ;
3537pub ( crate ) const TAKER_SWAPS_FNAME : & str = "taker_swaps" ;
@@ -223,3 +225,25 @@ pub(crate) fn read_channel_ids_info(path: &Path) -> ChannelIdsMap {
223225 channel_ids : new_hash_map ( ) ,
224226 }
225227}
228+
229+ pub ( crate ) fn read_virtual_channel_draft_store ( path : & Path ) -> VirtualChannelDraftStore {
230+ if let Ok ( file) = File :: open ( path) {
231+ if let Ok ( info) = VirtualChannelDraftStore :: read ( & mut BufReader :: new ( file) ) {
232+ return info;
233+ }
234+ }
235+ VirtualChannelDraftStore {
236+ entries : new_hash_map ( ) ,
237+ }
238+ }
239+
240+ pub ( crate ) fn read_virtual_channel_session_store ( path : & Path ) -> VirtualChannelSessionStore {
241+ if let Ok ( file) = File :: open ( path) {
242+ if let Ok ( info) = VirtualChannelSessionStore :: read ( & mut BufReader :: new ( file) ) {
243+ return info;
244+ }
245+ }
246+ VirtualChannelSessionStore {
247+ entries : new_hash_map ( ) ,
248+ }
249+ }
0 commit comments