Skip to content

Commit 481f92d

Browse files
committed
fix(esplora): replace .expect() with error handling in chain_update
1 parent 7d67591 commit 481f92d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

crates/esplora/src/async_ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ async fn chain_update<S: Sleeper>(
264264

265265
tip = tip
266266
.extend(conflicts.into_iter().rev().map(|b| (b.height, b.hash)))
267-
.expect("evicted are in order");
267+
.map_err(|_| Box::new(esplora_client::Error::InvalidResponse))?;
268268

269269
for (anchor, _txid) in anchors {
270270
let height = anchor.block_id.height;

crates/esplora/src/blocking_ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ fn chain_update(
249249

250250
tip = tip
251251
.extend(conflicts.into_iter().rev().map(|b| (b.height, b.hash)))
252-
.expect("evicted are in order");
252+
.map_err(|_| Box::new(esplora_client::Error::InvalidResponse))?;
253253

254254
for (anchor, _) in anchors {
255255
let height = anchor.block_id.height;

0 commit comments

Comments
 (0)