broker: remove sequence number from individual channel structs

for now broker sets sequence number to 0 across the board
This commit is contained in:
irriden
2023-07-20 17:46:56 +00:00
parent 21ac62c42a
commit 6adf9ef144
2 changed files with 3 additions and 6 deletions

View File

@@ -41,7 +41,6 @@ impl Connections {
}
pub struct Channel {
pub sequence: u16,
pub sender: mpsc::Sender<ChannelRequest>,
pub pubkey: [u8; 33],
}

View File

@@ -33,7 +33,6 @@ impl Channel {
pub fn new(sender: mpsc::Sender<ChannelRequest>) -> Self {
Self {
sender,
sequence: 0,
pubkey: [0; 33], // init with empty pubkey
}
}
@@ -158,7 +157,7 @@ impl<C: 'static + Client> SignerLoop<C> {
.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<C: 'static + Client> SignerLoop<C> {
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());