Skip to content

Commit bc4a69b

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 9c572a9 commit bc4a69b

File tree

3 files changed

+469
-103
lines changed

3 files changed

+469
-103
lines changed

lightning/src/ln/mod.rs

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

2929
mod channel;
3030
mod onion_utils;
31+
mod wire;
3132

3233
#[cfg(test)]
3334
#[macro_use] mod functional_test_utils;

0 commit comments

Comments
 (0)