Skip to content

Commit c0e9ca3

Browse files
committed
Use Esplora's get_block_hash() method
1 parent ea47d7a commit c0e9ca3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/blockchain/esplora/async.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ impl GetTx for EsploraBlockchain {
125125
#[maybe_async]
126126
impl GetBlockHash for EsploraBlockchain {
127127
fn get_block_hash(&self, height: u64) -> Result<BlockHash, Error> {
128-
let block_header = await_or_block!(self.url_client.get_header(height as u32))?;
129-
Ok(block_header.block_hash())
128+
Ok(await_or_block!(self
129+
.url_client
130+
.get_block_hash(height as u32))?)
130131
}
131132
}
132133

src/blockchain/esplora/blocking.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ impl GetTx for EsploraBlockchain {
110110

111111
impl GetBlockHash for EsploraBlockchain {
112112
fn get_block_hash(&self, height: u64) -> Result<BlockHash, Error> {
113-
let block_header = self.url_client.get_header(height as u32)?;
114-
Ok(block_header.block_hash())
113+
Ok(self.url_client.get_block_hash(height as u32)?)
115114
}
116115
}
117116

0 commit comments

Comments
 (0)