Skip to content

Commit 7de9f52

Browse files
committed
Encapsulate message wire encoding into a module
Lightning messages are identified by a 2-byte type when encoded on the wire. Rather than expecting callers to know message types when sending messages to peers, have each message implement a trait defining the message type. Provide an interface for reading and writing messages as well as a Message enum for matching the decoded message, including unknown messages.
1 parent f70058e commit 7de9f52

File tree

3 files changed

+464
-103
lines changed

3 files changed

+464
-103
lines changed

lightning/src/ln/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub(crate) mod peer_channel_encryptor;
2424

2525
mod channel;
2626
mod onion_utils;
27+
mod wire;
2728

2829
#[cfg(test)]
2930
#[macro_use] mod functional_test_utils;

0 commit comments

Comments
 (0)