Skip to content

Commit

Permalink
Merge pull request #1143 from MutinyWallet/gateway-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman authored Apr 16, 2024
2 parents c98f9f1 + 46bd19f commit 217b58a
Showing 1 changed file with 13 additions and 1 deletion.
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

0 comments on commit 217b58a

Please sign in to comment.