Skip to content

Commit

Permalink
Merge pull request #45 from getAlby/fix/re-enable-esplora-client-time…
Browse files Browse the repository at this point in the history
…outs

fix: re-enable esplora client timeouts with a higher timeout value
  • Loading branch information
rolznz authored Aug 9, 2024
2 parents 4a8c017 + 2f97d9a commit 02074c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/builder.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::config::{
default_user_config, Config, BDK_CLIENT_CONCURRENCY, BDK_CLIENT_STOP_GAP,
/*DEFAULT_ESPLORA_CLIENT_TIMEOUT_SECS, */ DEFAULT_ESPLORA_SERVER_URL,
WALLET_KEYS_SEED_LEN,
DEFAULT_ESPLORA_CLIENT_TIMEOUT_SECS, DEFAULT_ESPLORA_SERVER_URL, WALLET_KEYS_SEED_LEN,
};
use crate::connection::ConnectionManager;
use crate::event::EventQueue;
Expand Down Expand Up @@ -559,9 +558,8 @@ fn build_with_store_internal(

let (blockchain, tx_sync, tx_broadcaster, fee_estimator) = match chain_data_source_config {
Some(ChainDataSourceConfig::Esplora(server_url)) => {
let /*mut */client_builder = esplora_client::Builder::new(&server_url.clone());
// Alby - disable timeout due to possible blocking behaviour
// client_builder = client_builder.timeout(DEFAULT_ESPLORA_CLIENT_TIMEOUT_SECS);
let mut client_builder = esplora_client::Builder::new(&server_url.clone());
client_builder = client_builder.timeout(DEFAULT_ESPLORA_CLIENT_TIMEOUT_SECS);
let esplora_client = client_builder.build_async().unwrap();
let tx_sync = Arc::new(EsploraSyncClient::from_client(
esplora_client.clone(),
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub(crate) const BDK_CLIENT_CONCURRENCY: u8 = 4;
pub(crate) const DEFAULT_ESPLORA_SERVER_URL: &str = "https://blockstream.info/api";

// The default Esplora client timeout we're using.
// pub(crate) const DEFAULT_ESPLORA_CLIENT_TIMEOUT_SECS: u64 = 10;
pub(crate) const DEFAULT_ESPLORA_CLIENT_TIMEOUT_SECS: u64 = 100; // Alby - higher than the sync timeout to avoid deadlocks // 10;

// The timeout after which we abandon retrying failed payments.
pub(crate) const LDK_PAYMENT_RETRY_TIMEOUT: Duration = Duration::from_secs(50); // (10);
Expand Down

0 comments on commit 02074c7

Please sign in to comment.