Skip to content

Commit dce5a58

Browse files
committed
Drop tokio blocking now that poll_for_user_input is async
1 parent bea3566 commit dce5a58

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

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;
@@ -438,12 +438,12 @@ pub(crate) async fn poll_for_user_input(
438438
continue;
439439
},
440440
};
441-
if tokio::runtime::Handle::current()
442-
.block_on(connect_peer_if_necessary(
443-
pubkey,
444-
peer_addr,
445-
peer_manager.clone(),
446-
))
441+
if connect_peer_if_necessary(
442+
pubkey,
443+
peer_addr,
444+
peer_manager.clone(),
445+
)
446+
.await
447447
.is_ok()
448448
{
449449
println!("SUCCESS: connected to peer {}", pubkey);

0 commit comments

Comments
 (0)