@@ -19,6 +19,7 @@ use bdk_wallet::bitcoin::hex::{Case, DisplayHex};
1919use std:: collections:: BTreeMap ;
2020use std:: convert:: TryFrom ;
2121use std:: sync:: Arc ;
22+ use std:: time:: Duration ;
2223
2324/// Wrapper around an electrum_client::ElectrumApi which includes an internal in-memory transaction
2425/// cache to avoid re-fetching already downloaded transactions.
@@ -29,7 +30,7 @@ pub struct ElectrumClient(BdkBdkElectrumClient<bdk_electrum::electrum_client::Cl
2930impl ElectrumClient {
3031 /// Creates a new bdk client from a electrum_client::ElectrumApi
3132 /// Optional: Set the proxy of the builder
32- /// Optional: Set the timeout of the builder
33+ /// Optional: Set the timeout (in seconds) of the builder
3334 /// Optional: Set the retry attempts number of the builder
3435 /// Optional: Set whether the server's TLS certificate is validated.
3536 #[ uniffi:: constructor( default ( socks5 = None , timeout = None , retry = None , validate_domain = true ) ) ]
@@ -43,7 +44,7 @@ impl ElectrumClient {
4344 let mut config = bdk_electrum:: electrum_client:: ConfigBuilder :: new ( ) ;
4445 config = config. validate_domain ( validate_domain) ;
4546 if let Some ( timeout) = timeout {
46- config = config. timeout ( Some ( timeout) ) ;
47+ config = config. timeout ( Some ( Duration :: from_secs ( timeout. into ( ) ) ) ) ;
4748 }
4849 if let Some ( retry) = retry {
4950 config = config. retry ( retry) ;
@@ -179,7 +180,7 @@ impl ElectrumClient {
179180 pub fn estimate_fee ( & self , number : u64 ) -> Result < f64 , ElectrumError > {
180181 self . 0
181182 . inner
182- . estimate_fee ( number as usize )
183+ . estimate_fee ( number as usize , None )
183184 . map_err ( ElectrumError :: from)
184185 }
185186
0 commit comments