Skip to content

Create descriptor-based wallet by default if above bitcoin v21.0+ #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,21 @@ impl BitcoinD {
// to be compatible with different version, in the end we are only interested if
// the call is succesfull not in the returned value.
if client_base.call::<Value>("getblockchaininfo", &[]).is_ok() {
let desc_wallet = if cfg!(not(any(
feature = "0_20_1",
feature = "0_20_0",
feature = "0_19_1",
feature = "0_19_0_1",
feature = "0_18_1",
feature = "0_18_0",
feature = "0_17_1"
))) {
Some(true)
} else {
None
};
client_base
.create_wallet("default", None, None, None, None, None)
.create_wallet("default", None, None, None, None, desc_wallet)
.unwrap();
break Client::new(&node_url_default, Auth::CookieFile(cookie_file.clone()))
.unwrap();
Expand Down