diff --git a/broker/Cargo.lock b/broker/Cargo.lock index 46ad7c5..c6704fa 100644 --- a/broker/Cargo.lock +++ b/broker/Cargo.lock @@ -1713,7 +1713,7 @@ dependencies = [ [[package]] name = "lss-connector" version = "0.1.0" -source = "git+https://github.com/stakwork/sphinx-rs#e4089d251ceec05540db4f893d5879544fa4055b" +source = "git+https://github.com/stakwork/sphinx-rs#da6850edff5dd6ba61a3c6bb63c8ef2bb967ddd3" dependencies = [ "anyhow", "lightning-storage-server", @@ -3173,7 +3173,7 @@ dependencies = [ [[package]] name = "sphinx-auther" version = "0.1.12" -source = "git+https://github.com/stakwork/sphinx-rs#e4089d251ceec05540db4f893d5879544fa4055b" +source = "git+https://github.com/stakwork/sphinx-rs#da6850edff5dd6ba61a3c6bb63c8ef2bb967ddd3" dependencies = [ "anyhow", "base64 0.13.1", @@ -3185,7 +3185,7 @@ dependencies = [ [[package]] name = "sphinx-glyph" version = "0.1.2" -source = "git+https://github.com/stakwork/sphinx-rs#e4089d251ceec05540db4f893d5879544fa4055b" +source = "git+https://github.com/stakwork/sphinx-rs#da6850edff5dd6ba61a3c6bb63c8ef2bb967ddd3" dependencies = [ "anyhow", "hex", @@ -3231,7 +3231,7 @@ dependencies = [ [[package]] name = "sphinx-signer" version = "0.1.0" -source = "git+https://github.com/stakwork/sphinx-rs#e4089d251ceec05540db4f893d5879544fa4055b" +source = "git+https://github.com/stakwork/sphinx-rs#da6850edff5dd6ba61a3c6bb63c8ef2bb967ddd3" dependencies = [ "anyhow", "bip39", diff --git a/broker/src/lss.rs b/broker/src/lss.rs index 07df782..2310aae 100644 --- a/broker/src/lss.rs +++ b/broker/src/lss.rs @@ -14,7 +14,10 @@ pub async fn lss_setup(uri: &str, mqtt_tx: mpsc::Sender) -> Resu let reply = ChannelRequest::send(topics::LSS_MSG, msg_bytes, &mqtt_tx).await?; let ir = Response::from_slice(&reply)?.as_init()?; - let (lss_conn, msg_bytes2) = LssBroker::new(uri, ir, spk).await?; + let lss_conn = LssBroker::new(uri, ir.clone(), spk).await?; + // this only returns the initial state if it was requested by signer + let msg_bytes2 = lss_conn.get_created_state_msg(&ir).await?; + let reply2 = ChannelRequest::send(topics::LSS_MSG, msg_bytes2, &mqtt_tx).await?; let cr = Response::from_slice(&reply2)?.as_created()?; @@ -58,7 +61,8 @@ pub fn lss_tasks(lss_conn: LssBroker, mut lss_rx: mpsc::Receiver, mut re async fn reconnect_dance(cid: &str, lss_conn: &LssBroker, mqtt_tx: &mpsc::Sender) -> Result<()> { let init_bytes = lss_conn.make_init_msg().await?; let reply = ChannelRequest::send_for(cid, topics::LSS_MSG, init_bytes, mqtt_tx).await?; - let state_bytes = lss_conn.get_initial_state_msg(&reply).await?; + let ir = Response::from_slice(&reply)?.as_init()?; + let state_bytes = lss_conn.get_created_state_msg(&ir).await?; let reply2 = ChannelRequest::send_for(cid, topics::LSS_MSG, state_bytes, mqtt_tx).await?; let cr = Response::from_slice(&reply2)?.as_created()?; lss_conn.handle(Response::Created(cr)).await?;