Skip to content

Commit a93610d

Browse files
Added validate-domain option config in utils.rs and made changes required to that.
1 parent 08ca115 commit a93610d

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,13 +9,8 @@
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
Info, LightClient, NodeBuilderExt, Receiver,
@@ -24,6 +19,10 @@ use bdk_kyoto::{
2419
builder::NodeBuilder,
2520
};
2621
use bdk_wallet::bitcoin::{Address, Network, OutPoint, ScriptBuf};
22+
use electrum_client::ConfigBuilder;
23+
use std::fmt::Display;
24+
use std::path::{Path, PathBuf};
25+
use std::str::FromStr;
2726

2827
#[cfg(any(
2928
feature = "electrum",
@@ -162,7 +161,8 @@ pub(crate) fn new_blockchain_client(
162161
let client = match wallet_opts.client_type {
163162
#[cfg(feature = "electrum")]
164163
ClientType::Electrum => {
165-
let client = bdk_electrum::electrum_client::Client::new(url)
164+
let config = ConfigBuilder::new().validate_domain(true).build();
165+
let client = bdk_electrum::electrum_client::Client::from_config(url, config)
166166
.map(bdk_electrum::BdkElectrumClient::new)?;
167167
BlockchainClient::Electrum {
168168
client: Box::new(client),

0 commit comments

Comments
 (0)