Skip to content

Commit 06a8e3c

Browse files
committed
Drop tokio blocking now that poll_for_user_input is async
1 parent 32578c2 commit 06a8e3c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/cli.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ pub(crate) async fn poll_for_user_input(
111111
},
112112
};
113113

114-
if tokio::runtime::Handle::current()
115-
.block_on(connect_peer_if_necessary(
116-
pubkey,
117-
peer_addr,
118-
peer_manager.clone(),
119-
))
114+
if connect_peer_if_necessary(
115+
pubkey,
116+
peer_addr,
117+
peer_manager.clone(),
118+
)
119+
.await
120120
.is_err()
121121
{
122122
continue;
@@ -435,12 +435,12 @@ pub(crate) async fn poll_for_user_input(
435435
continue;
436436
},
437437
};
438-
if tokio::runtime::Handle::current()
439-
.block_on(connect_peer_if_necessary(
440-
pubkey,
441-
peer_addr,
442-
peer_manager.clone(),
443-
))
438+
if connect_peer_if_necessary(
439+
pubkey,
440+
peer_addr,
441+
peer_manager.clone(),
442+
)
443+
.await
444444
.is_ok()
445445
{
446446
println!("SUCCESS: connected to peer {}", pubkey);

0 commit comments

Comments
 (0)