]> Untitled Git - bdk/commitdiff
fix(bdk_esplora): use `get_blocks_infos` instead of `get_blocks`
authorLeonardo Lima <oleonardolima@users.noreply.github.com>
Tue, 24 Feb 2026 14:22:03 +0000 (11:22 -0300)
committerLeonardo Lima <oleonardolima@users.noreply.github.com>
Tue, 24 Feb 2026 14:27:34 +0000 (11:27 -0300)
crates/esplora/src/async_ext.rs
crates/esplora/src/blocking_ext.rs

index d504a4723fd5e6aace782962dec12c3944d85f83..0c2f8120a78877e2e6e2f6365b0766da19aba9a3 100644 (file)
@@ -184,10 +184,10 @@ async fn fetch_latest_blocks<S: Sleeper>(
     client: &esplora_client::AsyncClient<S>,
 ) -> Result<BTreeMap<u32, BlockHash>, Error> {
     Ok(client
-        .get_blocks(None)
+        .get_block_infos(None)
         .await?
         .into_iter()
-        .map(|b| (b.time.height, b.id))
+        .map(|b| (b.height, b.id))
         .collect())
 }
 
index 9413c14afd148fcacfa64566e9ad706da795a64f..c1bcf29a862f67ad139967a06552b03da8109586 100644 (file)
@@ -170,9 +170,9 @@ fn fetch_latest_blocks(
     client: &esplora_client::BlockingClient,
 ) -> Result<BTreeMap<u32, BlockHash>, Error> {
     Ok(client
-        .get_blocks(None)?
+        .get_block_infos(None)?
         .into_iter()
-        .map(|b| (b.time.height, b.id))
+        .map(|b| (b.height, b.id))
         .collect())
 }