Skip to content

Commit 63307ce

Browse files
committed
Drop tokio blocking now that poll_for_user_input is async
1 parent 18e9767 commit 63307ce

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
@@ -107,12 +107,12 @@ pub(crate) async fn poll_for_user_input(
107107
},
108108
};
109109

110-
if tokio::runtime::Handle::current()
111-
.block_on(connect_peer_if_necessary(
112-
pubkey,
113-
peer_addr,
114-
peer_manager.clone(),
115-
))
110+
if connect_peer_if_necessary(
111+
pubkey,
112+
peer_addr,
113+
peer_manager.clone(),
114+
)
115+
.await
116116
.is_err()
117117
{
118118
continue;
@@ -429,12 +429,12 @@ pub(crate) async fn poll_for_user_input(
429429
continue;
430430
},
431431
};
432-
if tokio::runtime::Handle::current()
433-
.block_on(connect_peer_if_necessary(
434-
pubkey,
435-
peer_addr,
436-
peer_manager.clone(),
437-
))
432+
if connect_peer_if_necessary(
433+
pubkey,
434+
peer_addr,
435+
peer_manager.clone(),
436+
)
437+
.await
438438
.is_ok()
439439
{
440440
println!("SUCCESS: connected to peer {}", pubkey);

0 commit comments

Comments
 (0)