}
}
-pub(crate) async fn poll_for_user_input(
+pub(crate) fn poll_for_user_input(
peer_manager: Arc<PeerManager>, channel_manager: Arc<ChannelManager>,
keys_manager: Arc<KeysManager>, network_graph: Arc<NetworkGraph>,
onion_messenger: Arc<OnionMessenger>, inbound_payments: Arc<Mutex<PaymentInfoStorage>>,
continue;
}
- if connect_peer_if_necessary(pubkey, peer_addr, peer_manager.clone())
- .await
+ if tokio::runtime::Handle::current()
+ .block_on(connect_peer_if_necessary(
+ pubkey,
+ peer_addr,
+ peer_manager.clone(),
+ ))
.is_err()
{
continue;
continue;
}
};
- if connect_peer_if_necessary(pubkey, peer_addr, peer_manager.clone())
- .await
+ if tokio::runtime::Handle::current()
+ .block_on(connect_peer_if_necessary(
+ pubkey,
+ peer_addr,
+ peer_manager.clone(),
+ ))
.is_ok()
{
println!("SUCCESS: connected to peer {}", pubkey);
"listpeers" => list_peers(peer_manager.clone()),
"signmessage" => {
const MSG_STARTPOS: usize = "signmessage".len() + 1;
- if line.as_bytes().len() <= MSG_STARTPOS {
+ if line.trim().as_bytes().len() <= MSG_STARTPOS {
println!("ERROR: signmsg requires a message");
continue;
}
println!(
"{:?}",
lightning::util::message_signing::sign(
- &line.as_bytes()[MSG_STARTPOS..],
+ &line.trim().as_bytes()[MSG_STARTPOS..],
&keys_manager.get_node_secret_key()
)
);