Skip to content

Commit 2c315a3

Browse files
committed
f docs on encrypt_message_with_header_0s
1 parent d9c8ef6 commit 2c315a3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lightning/src/ln/peer_channel_encryptor.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,12 @@ impl PeerChannelEncryptor {
427427
Ok(self.their_node_id.unwrap().clone())
428428
}
429429

430+
/// Builds sendable bytes for a message.
431+
///
432+
/// `msgbuf` must begin with 16 + 2 dummy/0 bytes, which will be filled with the encrypted
433+
/// message length and its MAC. It should then be followed by the message bytes themselves
434+
/// (including the two byte message type), and have an extra 16 bytes of capacity remaining for
435+
/// the message MAC, which will be appended to the vec.
430436
fn encrypt_message_with_header_0s(&mut self, msgbuf: &mut Vec<u8>) {
431437
let msg_len = msgbuf.len() - 16 - 2;
432438
if msg_len > LN_MAX_MSG_LEN {

0 commit comments

Comments
 (0)