Skip to content

Commit b67237e

Browse files
committed
Fixes a clippy issue in main raised by rustc 1.61.0
Fixes a clippy issue in main where an async method was called while holding the DB MutexGuard. https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock
1 parent 9e95b6a commit b67237e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

teos/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ async fn main() {
155155
);
156156
let mut derefed = bitcoin_cli.deref();
157157
// Load last known block from DB if found. Poll it from Bitcoind otherwise.
158-
let tip = if let Ok(block_hash) = dbm.lock().unwrap().load_last_known_block() {
158+
let last_known_block = dbm.lock().unwrap().load_last_known_block();
159+
let tip = if let Ok(block_hash) = last_known_block {
159160
derefed
160161
.get_header(&block_hash, None)
161162
.await

0 commit comments

Comments
 (0)