Ensure ElectrumBlockchain client also uses config

This commit is contained in:
pokkst 2023-08-05 10:38:02 -05:00
parent f02c7712fb
commit cfaf9ee257
No known key found for this signature in database
GPG Key ID: 90C2ED85E67A50FF

View File

@ -733,7 +733,7 @@ impl Client {
.socks5(Option::from(Socks5Config::new(electrum_socks5_proxy_string.to_string()))).unwrap() // use Tor with the Electrum client
}
let config = config_builder.build();
let electrum = bdk::electrum_client::Client::from_config(electrum_rpc_url.as_str(), config)
let electrum = bdk::electrum_client::Client::from_config(electrum_rpc_url.as_str(), config.clone())
.context("Failed to initialize Electrum RPC client")?;
// Initially fetch the latest block for storing the height.
// We do not act on this subscription after this call.
@ -741,7 +741,7 @@ impl Client {
.block_headers_subscribe()
.context("Failed to subscribe to header notifications")?;
let client = bdk::electrum_client::Client::new(electrum_rpc_url.as_str())
let client = bdk::electrum_client::Client::from_config(electrum_rpc_url.as_str(), config.clone())
.context("Failed to initialize Electrum RPC client")?;
let blockchain = ElectrumBlockchain::from(client);
let last_sync = Instant::now()