Skip to content

Commit 3dca4f6

Browse files
committed
block: Add get_block_hash.
1 parent 1c82ab0 commit 3dca4f6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/client/rpc_api.rs

+5
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,11 @@ impl RpcApi for Client {
628628

629629
Ok(vec![tip])
630630
}
631+
632+
#[tracing::instrument(skip_all)]
633+
fn get_block_hash(&self, height: u64) -> bitcoincore_rpc::Result<bitcoin::BlockHash> {
634+
Ok(self.ledger.get_block_with_height(height as u32)?.block_hash())
635+
}
631636
}
632637

633638
#[cfg(test)]

src/ledger/block.rs

-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ impl Ledger {
182182
"SELECT body FROM blocks WHERE hash = ?1",
183183
params![encoded_hash],
184184
|row| {
185-
tracing::error!("row {:?}", row);
186185
Ok(row.get::<_, Vec<u8>>(0).unwrap())
187186
},
188187
) {

0 commit comments

Comments
 (0)