mirror of
https://github.com/stakwork/sphinx-key.git
synced 2025-12-17 07:14:23 +01:00
Improve the logging of key user information
This commit is contained in:
@@ -79,6 +79,7 @@ pub fn start_config_server_and_wait(
|
||||
|
||||
let httpd = conn::http::config_server(mutex.clone());
|
||||
let mut wait = mutex.0.lock().unwrap();
|
||||
log::info!("Waiting for data from the phone!");
|
||||
|
||||
let config: &Config = loop {
|
||||
if let Some(conf) = &*wait {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::conn::mqtt::{QOS, RETURN_TOPIC, TOPIC};
|
||||
use crate::core::init::make_init_msg;
|
||||
use crate::core::config::Config;
|
||||
|
||||
use sphinx_key_signer::lightning_signer::bitcoin::Network;
|
||||
use sphinx_key_signer::vls_protocol::model::PubKey;
|
||||
@@ -41,8 +42,10 @@ pub fn make_event_loop(
|
||||
do_log: bool,
|
||||
led_tx: mpsc::Sender<Status>,
|
||||
seed: [u8; 32],
|
||||
config: Config
|
||||
) -> Result<()> {
|
||||
while let Ok(event) = rx.recv() {
|
||||
log::info!("BROKER IP AND PORT: {}", config.broker);
|
||||
match event {
|
||||
Event::Connected => {
|
||||
log::info!("SUBSCRIBE to {}", TOPIC);
|
||||
|
||||
@@ -84,18 +84,18 @@ fn main() -> Result<()> {
|
||||
};
|
||||
log::info!("Network set to {:?}", network);
|
||||
log::info!(">>>>>>>>>>> blocking forever...");
|
||||
make_event_loop(mqtt_client, rx, network, do_log, led_tx, exist.seed)?;
|
||||
log::info!("{:?}", exist);
|
||||
make_event_loop(mqtt_client, rx, network, do_log, led_tx, exist.seed, exist)?;
|
||||
} else {
|
||||
led_tx.send(Status::WifiAccessPoint).unwrap();
|
||||
println!("=============> START SERVER NOW AND WAIT <==============");
|
||||
if let Ok((wifi, config)) = start_config_server_and_wait(default_nvs.clone()) {
|
||||
if let Ok((_wifi, config)) = start_config_server_and_wait(default_nvs.clone()) {
|
||||
let conf = rmp_serde::to_vec(&config).expect("couldnt rmp Config");
|
||||
store
|
||||
.put_raw("config", &conf[..])
|
||||
.expect("could not store config");
|
||||
println!("CONFIG SAVED");
|
||||
drop(wifi);
|
||||
thread::sleep(Duration::from_secs(1));
|
||||
loop {};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user