Skip to content

Commit 3c44988

Browse files
committed
Add node id to custom message callback
1 parent de9fba8 commit 3c44988

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lightning/src/ln/peer_handler.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use bitcoin::hashes::{HashEngine, Hash};
4747
pub trait CustomMessageHandler: wire::CustomMessageReader {
4848
/// Called with the message type that was received and the buffer to be read.
4949
/// Can return a `MessageHandlingError` if the message could not be handled.
50-
fn handle_custom_message(&self, msg: Self::CustomMessage) -> Result<(), LightningError>;
50+
fn handle_custom_message(&self, msg: Self::CustomMessage, org: &PublicKey) -> Result<(), LightningError>;
5151

5252
/// Gets the list of pending messages which were generated by the custom message
5353
/// handler, clearing the list in the process. The first tuple element must
@@ -102,7 +102,7 @@ impl wire::CustomMessageReader for IgnoringMessageHandler {
102102
}
103103

104104
impl CustomMessageHandler for IgnoringMessageHandler {
105-
fn handle_custom_message(&self, _msg: Self::CustomMessage) -> Result<(), LightningError> {
105+
fn handle_custom_message(&self, _msg: Self::CustomMessage, _org: &PublicKey) -> Result<(), LightningError> {
106106
// Since we always return `None` in the read the handle method should never be called.
107107
unreachable!();
108108
}
@@ -1087,7 +1087,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref, CMH: Deref> P
10871087
log_trace!(self.logger, "Received unknown odd message of type {}, ignoring", type_id);
10881088
},
10891089
wire::Message::Custom(custom) => {
1090-
self.custom_message_handler.handle_custom_message(custom)?;
1090+
self.custom_message_handler.handle_custom_message(custom, &peer.their_node_id.unwrap())?;
10911091
},
10921092
};
10931093
Ok(should_forward)

0 commit comments

Comments
 (0)