diff --git a/broker/Cargo.lock b/broker/Cargo.lock index 720dacd..4cf5b70 100644 --- a/broker/Cargo.lock +++ b/broker/Cargo.lock @@ -1713,6 +1713,7 @@ dependencies = [ [[package]] name = "lss-connector" version = "0.1.0" +source = "git+https://github.com/stakwork/sphinx-rs#2f25ab4dcb70c1372dce866d028158c7a346e679" dependencies = [ "anyhow", "lightning-storage-server", @@ -3172,7 +3173,7 @@ dependencies = [ [[package]] name = "sphinx-auther" version = "0.1.12" -source = "git+https://github.com/stakwork/sphinx-rs#edaae2c7c3a0839b63ebc6e88c6c135960686191" +source = "git+https://github.com/stakwork/sphinx-rs#2f25ab4dcb70c1372dce866d028158c7a346e679" dependencies = [ "anyhow", "base64 0.13.1", @@ -3184,7 +3185,7 @@ dependencies = [ [[package]] name = "sphinx-glyph" version = "0.1.2" -source = "git+https://github.com/stakwork/sphinx-rs#edaae2c7c3a0839b63ebc6e88c6c135960686191" +source = "git+https://github.com/stakwork/sphinx-rs#2f25ab4dcb70c1372dce866d028158c7a346e679" dependencies = [ "anyhow", "hex", @@ -3230,13 +3231,14 @@ dependencies = [ [[package]] name = "sphinx-signer" version = "0.1.0" -source = "git+https://github.com/stakwork/sphinx-rs#edaae2c7c3a0839b63ebc6e88c6c135960686191" +source = "git+https://github.com/stakwork/sphinx-rs#2f25ab4dcb70c1372dce866d028158c7a346e679" dependencies = [ "anyhow", "bip39", "fsdb", "hex", "log", + "lss-connector", "rand", "serde", "sphinx-glyph", diff --git a/broker/src/main.rs b/broker/src/main.rs index 30f489f..37e6baf 100644 --- a/broker/src/main.rs +++ b/broker/src/main.rs @@ -82,7 +82,13 @@ async fn run_main(parent_fd: i32) -> rocket::Rocket { let (lss_tx, lss_rx) = mpsc::channel(10000); let _lss_broker = if let Ok(lss_uri) = env::var("VLS_LSS") { // waits until LSS confirmation from signer - let lss_broker = lss_setup(&lss_uri, lss_rx, mqtt_tx.clone()).await.unwrap(); + let lss_broker = match lss_setup(&lss_uri, lss_rx, mqtt_tx.clone()).await{ + Ok(l) => l, + Err(e) => { + let _ = error_tx.send(e.to_string().as_bytes().to_vec()); + panic!("{:?}", e); + } + }; log::info!("=> lss broker connection created!"); Some(lss_broker) } else { @@ -141,8 +147,14 @@ pub async fn lss_setup(uri: &str, mut lss_rx: mpsc::Receiver, mqtt_tx: m let persister = lss_conn.persister(); tokio::task::spawn(async move{ while let Some(req) = lss_rx.recv().await { - let msg = lss_handle(&persister, &req.message).await.unwrap(); - let _ = req.reply_tx.send(msg); + match lss_handle(&persister, &req.message).await { + Ok(msg) => { + let _ = req.reply_tx.send(msg); + }, + Err(e) => { + log::error!("failed lss_handle {:?}", e); + } + } } });