Skip to content

Commit 2486f83

Browse files
committed
Merge remote-tracking branch 'upstream/master' into kwsantiago/1973-simplify-examples
2 parents a87715f + a09f12a commit 2486f83

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

crates/electrum/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ workspace = true
1414

1515
[dependencies]
1616
bdk_core = { path = "../core", version = "0.6.0" }
17-
electrum-client = { version = "0.23.1", features = [ "proxy" ], default-features = false }
18-
serde_json = "1.0"
17+
electrum-client = { version = "0.24.0", features = [ "proxy" ], default-features = false }
1918

2019
[dev-dependencies]
2120
bdk_testenv = { path = "../testenv" }

crates/electrum/src/bdk_electrum_client.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -551,23 +551,12 @@ impl<E: ElectrumApi> BdkElectrumClient<E> {
551551
}
552552
}
553553

554-
// Batch all get_merkle calls.
555-
let mut batch = electrum_client::Batch::default();
556-
for &(txid, height, _) in &to_fetch {
557-
batch.raw(
558-
"blockchain.transaction.get_merkle".into(),
559-
vec![
560-
electrum_client::Param::String(format!("{txid:x}")),
561-
electrum_client::Param::Usize(height),
562-
],
563-
);
564-
}
565-
let resps = self.inner.batch_call(&batch)?;
554+
// Fetch merkle proofs.
555+
let txids_and_heights = to_fetch.iter().map(|&(txid, height, _)| (txid, height));
556+
let proofs = self.inner.batch_transaction_get_merkle(txids_and_heights)?;
566557

567558
// Validate each proof, retrying once for each stale header.
568-
for ((txid, height, hash), resp) in to_fetch.into_iter().zip(resps.into_iter()) {
569-
let proof: electrum_client::GetMerkleRes = serde_json::from_value(resp)?;
570-
559+
for ((txid, height, hash), proof) in to_fetch.into_iter().zip(proofs.into_iter()) {
571560
let mut header = {
572561
let cache = self.block_header_cache.lock().unwrap();
573562
cache

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.87.0
1+
1.88.0

0 commit comments

Comments
 (0)