mirror of
https://github.com/stakwork/sphinx-key.git
synced 2025-12-18 07:44:21 +01:00
handle lss_handle errs, lss-connector master
This commit is contained in:
8
broker/Cargo.lock
generated
8
broker/Cargo.lock
generated
@@ -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",
|
||||
|
||||
@@ -82,7 +82,13 @@ async fn run_main(parent_fd: i32) -> rocket::Rocket<rocket::Build> {
|
||||
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<LssReq>, 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();
|
||||
match lss_handle(&persister, &req.message).await {
|
||||
Ok(msg) => {
|
||||
let _ = req.reply_tx.send(msg);
|
||||
},
|
||||
Err(e) => {
|
||||
log::error!("failed lss_handle {:?}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user