Skip to content

Commit 80e132f

Browse files
Added validate-domain option config in utils.rs and made changes required to that.
1 parent a2f5954 commit 80e132f

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ bdk_redb = { version = "0.1.0", optional = true }
3131
shlex = { version = "1.3.0", optional = true }
3232
tracing = "0.1.41"
3333
tracing-subscriber = "0.3.20"
34+
electrum-client = "0.24.0"
3435

3536
[features]
3637
default = ["repl", "sqlite"]

src/utils.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,18 @@
99
//! Utility Tools
1010
//!
1111
//! This module includes all the utility tools used by the App.
12-
use crate::error::BDKCliError as Error;
13-
use std::fmt::Display;
14-
use std::str::FromStr;
15-
16-
use std::path::{Path, PathBuf};
17-
1812
use crate::commands::WalletOpts;
13+
use crate::error::BDKCliError as Error;
1914
#[cfg(feature = "cbf")]
2015
use bdk_kyoto::{
2116
BuilderExt, Info, LightClient, Receiver, ScanType::Sync, UnboundedReceiver, Warning,
2217
builder::Builder,
2318
};
2419
use bdk_wallet::bitcoin::{Address, Network, OutPoint, ScriptBuf};
20+
use electrum_client::ConfigBuilder;
21+
use std::fmt::Display;
22+
use std::path::{Path, PathBuf};
23+
use std::str::FromStr;
2524

2625
#[cfg(any(
2726
feature = "electrum",
@@ -160,7 +159,8 @@ pub(crate) fn new_blockchain_client(
160159
let client = match wallet_opts.client_type {
161160
#[cfg(feature = "electrum")]
162161
ClientType::Electrum => {
163-
let client = bdk_electrum::electrum_client::Client::new(url)
162+
let config = ConfigBuilder::new().validate_domain(true).build();
163+
let client = bdk_electrum::electrum_client::Client::from_config(url, config)
164164
.map(bdk_electrum::BdkElectrumClient::new)?;
165165
BlockchainClient::Electrum {
166166
client: Box::new(client),

0 commit comments

Comments
 (0)