Skip to content

Commit

Permalink
Rename persister in handle_ldk_events to differentiate store
Browse files Browse the repository at this point in the history
Since we now have a `Persist`er which is separate from our
`FilesystemStore`, its useful to use different names to
differentiate the two.
  • Loading branch information
TheBlueMatt committed Sep 30, 2023
1 parent 4c4488e commit c10671c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ async fn handle_ldk_events(
channel_manager: &Arc<ChannelManager>, bitcoind_client: &BitcoindClient,
network_graph: &NetworkGraph, keys_manager: &KeysManager,
bump_tx_event_handler: &BumpTxEventHandler, inbound_payments: Arc<Mutex<PaymentInfoStorage>>,
outbound_payments: Arc<Mutex<PaymentInfoStorage>>, persister: &Arc<FilesystemStore>,
outbound_payments: Arc<Mutex<PaymentInfoStorage>>, fs_store: &Arc<FilesystemStore>,
network: Network, event: Event,
) {
match event {
Expand Down Expand Up @@ -270,7 +270,7 @@ async fn handle_ldk_events(
});
}
}
persister.write("", "", INBOUND_PAYMENTS_FNAME, &inbound.encode()).unwrap();
fs_store.write("", "", INBOUND_PAYMENTS_FNAME, &inbound.encode()).unwrap();
}
Event::PaymentSent { payment_preimage, payment_hash, fee_paid_msat, .. } => {
let mut outbound = outbound_payments.lock().unwrap();
Expand All @@ -294,7 +294,7 @@ async fn handle_ldk_events(
io::stdout().flush().unwrap();
}
}
persister.write("", "", OUTBOUND_PAYMENTS_FNAME, &outbound.encode()).unwrap();
fs_store.write("", "", OUTBOUND_PAYMENTS_FNAME, &outbound.encode()).unwrap();
}
Event::OpenChannelRequest {
ref temporary_channel_id, ref counterparty_node_id, ..
Expand Down Expand Up @@ -343,7 +343,7 @@ async fn handle_ldk_events(
let payment = outbound.payments.get_mut(&payment_hash).unwrap();
payment.status = HTLCStatus::Failed;
}
persister.write("", "", OUTBOUND_PAYMENTS_FNAME, &outbound.encode()).unwrap();
fs_store.write("", "", OUTBOUND_PAYMENTS_FNAME, &outbound.encode()).unwrap();
}
Event::PaymentForwarded {
prev_channel_id,
Expand Down Expand Up @@ -431,7 +431,7 @@ async fn handle_ldk_events(
let key = hex_utils::hex_str(&keys_manager.get_secure_random_bytes());
// Note that if the type here changes our read code needs to change as well.
let output: SpendableOutputDescriptor = output;
persister.write(PENDING_SPENDABLE_OUTPUT_DIR, "", &key, &output.encode()).unwrap();
fs_store.write(PENDING_SPENDABLE_OUTPUT_DIR, "", &key, &output.encode()).unwrap();
}
}
Event::ChannelPending { channel_id, counterparty_node_id, .. } => {
Expand Down

0 comments on commit c10671c

Please sign in to comment.