Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fedimint gateway cache before setting #1143

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion mutiny-core/src/federation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,20 @@ impl<S: MutinyStorage> FederationClient<S> {
// get lock immediately to block other actions until gateway is set
let mut gateway_lock = gateway_clone.write().await;
let lightning_module = client_clone.get_first_module::<LightningClientModule>();
let gateways = lightning_module.list_gateways().await;

match lightning_module.update_gateway_cache(true).await {
Ok(_) => {
log_trace!(logger_clone, "Updated lightning gateway cache");
}
Err(e) => {
log_error!(
logger_clone,
"Could not update lightning gateway cache: {e}"
);
}
}

let gateways = lightning_module.list_gateways().await;
if let Some(a) = get_gateway_preference(gateways, federation_id) {
log_info!(
logger_clone,
Expand Down
Loading