Skip to content

Commit ad6620d

Browse files
committed
Drop tokio blocking now that poll_for_user_input is async
1 parent 64b7577 commit ad6620d

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/cli.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,8 @@ 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(pubkey, peer_addr, peer_manager.clone())
115+
.await
120116
.is_err()
121117
{
122118
continue;
@@ -438,12 +434,8 @@ pub(crate) async fn poll_for_user_input(
438434
continue;
439435
},
440436
};
441-
if tokio::runtime::Handle::current()
442-
.block_on(connect_peer_if_necessary(
443-
pubkey,
444-
peer_addr,
445-
peer_manager.clone(),
446-
))
437+
if connect_peer_if_necessary(pubkey, peer_addr, peer_manager.clone())
438+
.await
447439
.is_ok()
448440
{
449441
println!("SUCCESS: connected to peer {}", pubkey);

0 commit comments

Comments
 (0)