Skip to content

Commit bf980c9

Browse files
committed
Clean up peel_onion name, parameters, and docs
For consistency with other functions and doc cleanliness.
1 parent dd8be70 commit bf980c9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lightning/src/onion_message/messenger.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,13 @@ where
345345
}))
346346
}
347347

348-
/// Decode one layer of an incoming onion message
349-
/// Returns either a Forward (another onion message), or Receive (decrypted content)
350-
pub fn peel_onion<NS: Deref, L: Deref, CMH: Deref>(
351-
node_signer: NS, secp_ctx: &Secp256k1<secp256k1::All>, logger: L, custom_handler: CMH,
352-
msg: &OnionMessage,
348+
/// Decode one layer of an incoming [`OnionMessage`].
349+
///
350+
/// Returns either the next layer of the onion for forwarding or the decrypted content for the
351+
/// receiver.
352+
pub fn peel_onion_message<NS: Deref, L: Deref, CMH: Deref>(
353+
msg: &OnionMessage, secp_ctx: &Secp256k1<secp256k1::All>, node_signer: NS, logger: L,
354+
custom_handler: CMH,
353355
) -> Result<PeeledOnion<<<CMH>::Target as CustomOnionMessageHandler>::CustomMessage>, ()>
354356
where
355357
NS::Target: NodeSigner,
@@ -585,8 +587,8 @@ where
585587
CMH::Target: CustomOnionMessageHandler,
586588
{
587589
fn handle_onion_message(&self, _peer_node_id: &PublicKey, msg: &OnionMessage) {
588-
match peel_onion(
589-
&*self.node_signer, &self.secp_ctx, &*self.logger, &*self.custom_handler, msg
590+
match peel_onion_message(
591+
msg, &self.secp_ctx, &*self.node_signer, &*self.logger, &*self.custom_handler
590592
) {
591593
Ok(PeeledOnion::Receive(message, path_id, reply_path)) => {
592594
log_trace!(self.logger,

0 commit comments

Comments
 (0)