Skip to content

Commit 33790f1

Browse files
committed
fix(bitcoin-da): propagate get_block_info error in determine_tx_status instead of defaulting to 0
Using .unwrap_or(0) silently sets block_height to 0 when get_block_info fails for a confirmed transaction, corrupting the monitored status with a false genesis-block height. Propagate the error with ? instead.
1 parent 0f40b48 commit 33790f1

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

crates/bitcoin-da/src/monitoring.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,9 +707,8 @@ impl MonitoringService {
707707
let block_height = self
708708
.client
709709
.get_block_info(&block_hash)
710-
.await
711-
.map(|header| header.height as u64)
712-
.unwrap_or(0);
710+
.await?
711+
.height as u64;
713712

714713
if confirmations >= self.finality_depth {
715714
TxStatus::Finalized {

0 commit comments

Comments
 (0)