]> Untitled Git - bdk/commitdiff
Permit to not set timeout in ElectrumBlockchainConfig
authorRiccardo Casatta <riccardo@casatta.it>
Mon, 11 Jan 2021 10:37:34 +0000 (11:37 +0100)
committerRiccardo Casatta <riccardo@casatta.it>
Mon, 11 Jan 2021 13:06:56 +0000 (14:06 +0100)
Allowing to use socks5 which requires None timeout

Cargo.toml
src/blockchain/electrum.rs

index c4cccea334fc6910ec7b23fe22a3c651a756336c..b4f392f022a4c722f6663407cac9006b5af3eccb 100644 (file)
@@ -22,7 +22,7 @@ rand = "^0.7"
 
 # Optional dependencies
 sled = { version = "0.34", optional = true }
-electrum-client = { version = "0.4.0-beta.1", optional = true }
+electrum-client = { version = "0.5.0-beta.1", optional = true }
 reqwest = { version = "0.10", optional = true, features = ["json"] }
 futures = { version = "0.3", optional = true }
 async-trait = { version = "0.1", optional = true }
index 0d35c37e71a9412730f9e73d9db42dd303cd9a9e..65af45fc8fc68b9def490138dd838efa11bedbad 100644 (file)
@@ -168,7 +168,7 @@ pub struct ElectrumBlockchainConfig {
     /// Request retry count
     pub retry: u8,
     /// Request timeout (seconds)
-    pub timeout: u8,
+    pub timeout: Option<u8>,
 }
 
 impl ConfigurableBlockchain for ElectrumBlockchain {
@@ -178,8 +178,8 @@ impl ConfigurableBlockchain for ElectrumBlockchain {
         let socks5 = config.socks5.as_ref().map(Socks5Config::new);
         let electrum_config = ConfigBuilder::new()
             .retry(config.retry)
-            .socks5(socks5)?
             .timeout(config.timeout)?
+            .socks5(socks5)?
             .build();
 
         Ok(ElectrumBlockchain(Client::from_config(