diff --git a/broker/src/conn.rs b/broker/src/conn.rs index a7421d4..9c02d2a 100644 --- a/broker/src/conn.rs +++ b/broker/src/conn.rs @@ -41,7 +41,6 @@ impl Connections { } pub struct Channel { - pub sequence: u16, pub sender: mpsc::Sender, pub pubkey: [u8; 33], } diff --git a/broker/src/looper.rs b/broker/src/looper.rs index 02f7d26..2b50e5b 100644 --- a/broker/src/looper.rs +++ b/broker/src/looper.rs @@ -33,7 +33,6 @@ impl Channel { pub fn new(sender: mpsc::Sender) -> Self { Self { sender, - sequence: 0, pubkey: [0; 33], // init with empty pubkey } } @@ -158,7 +157,7 @@ impl SignerLoop { .as_ref() .map(|c| c.peer_id.serialize()) .unwrap_or([0u8; 33]); - let md = parser::raw_request_from_bytes(message, self.chan.sequence, peer_id, dbid)?; + let md = parser::raw_request_from_bytes(message, 0u16, peer_id, dbid)?; // send to signer log::info!("SEND ON {}", topics::VLS); let (res_topic, res) = self.send_request_wait(topics::VLS, md)?; @@ -178,9 +177,8 @@ impl SignerLoop { the_res = res2; } // create reply bytes for CLN - let reply = parser::raw_response_from_bytes(the_res, self.chan.sequence)?; - // add to the sequence - self.chan.sequence = self.chan.sequence.wrapping_add(1); + let reply = parser::raw_response_from_bytes(the_res, 0u16)?; + // catch the pubkey if its the first one connection if catch_init { let _ = self.set_channel_pubkey(reply.clone());