Skip to content

Commit 905028b

Browse files
committed
Clean up peel_onion name, parameters, and docs
For consistency with other functions and doc cleanliness.
1 parent 80ae66a commit 905028b

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lightning/src/onion_message/messenger.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,13 @@ where
344344
}))
345345
}
346346

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

0 commit comments

Comments
 (0)