Skip to content
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

feat: bitcoin 25 support #495

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bitcoin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ light-client = []

[dependencies]
thiserror = "1.0"
bitcoincore-rpc = { git = "https://github.com/rust-bitcoin/rust-bitcoincore-rpc", rev = "7bd815f1e1ae721404719ee8e6867064b7c68494" }
bitcoincore-rpc = { git = "https://github.com/interlay/rust-bitcoincore-rpc", rev = "671a78f638179c8951c9932061fd2bb348313a2c" }
hex = "0.4.2"
async-trait = "0.1.40"
tokio = { version = "1.0", features = ["full"] }
Expand Down
8 changes: 5 additions & 3 deletions bitcoin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub const DEFAULT_MAX_TX_COUNT: usize = 100_000_000;
/// the bitcoin core version.
/// See https://github.com/bitcoin/bitcoin/blob/833add0f48b0fad84d7b8cf9373a349e7aef20b4/src/rpc/net.cpp#L627
/// and https://github.com/bitcoin/bitcoin/blob/833add0f48b0fad84d7b8cf9373a349e7aef20b4/src/clientversion.h#L33-L37
pub const BITCOIN_CORE_VERSION_23: usize = 230_000;
pub const BITCOIN_CORE_VERSION_26: usize = 260_000;
const NOT_IN_MEMPOOL_ERROR_CODE: i32 = BitcoinRpcError::RpcInvalidAddressOrKey as i32;

// Time to sleep before retry on startup.
Expand Down Expand Up @@ -283,7 +283,7 @@ async fn connect(rpc: &Client, connection_timeout: Duration) -> Result<Network,
info!("Connected to {}", chain);
info!("Bitcoin version {}", version);

if version >= BITCOIN_CORE_VERSION_23 {
if version >= BITCOIN_CORE_VERSION_26 {
return Err(Error::IncompatibleVersion(version))
}

Expand Down Expand Up @@ -1052,7 +1052,9 @@ impl BitcoinCoreApi for BitcoinCore {
} else {
info!("Creating wallet {wallet_name}...");
// wallet does not exist, create
let result = self.rpc.create_wallet(wallet_name, None, None, None, None)?;
let result = self
.rpc
.create_wallet(wallet_name, None, None, None, None, Some(false))?;
if let Some(warning) = result.warning {
if !warning.is_empty() {
warn!("Received warning while creating wallet {wallet_name}: {warning}");
Expand Down