Skip to content

Commit f01d613

Browse files
committed
bound peelonion by custom message contents only
1 parent de0e102 commit f01d613

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lightning/src/onion_message/messenger.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,13 +248,11 @@ pub trait CustomOnionMessageHandler {
248248

249249
/// A processed incoming onion message, containing either a Forward (another onion message)
250250
/// or a Receive payload with decrypted contents.
251-
pub enum PeeledOnion<CMH: Deref> where
252-
CMH::Target: CustomOnionMessageHandler,
253-
{
251+
pub enum PeeledOnion<CM: CustomOnionMessageContents> {
254252
/// Forwarded onion, with the next node id and a new onion
255253
Forward(PublicKey, msgs::OnionMessage),
256254
/// Received onion message, with decrypted contents, path_id, and reply path
257-
Receive(OnionMessageContents<<<CMH as Deref>::Target as CustomOnionMessageHandler>::CustomMessage>, Option<[u8; 32]>, Option<BlindedPath>)
255+
Receive(OnionMessageContents<CM>, Option<[u8; 32]>, Option<BlindedPath>)
258256
}
259257

260258
/// Create an onion message with contents `message` to the destination of `path`.
@@ -319,7 +317,7 @@ where
319317
pub fn peel_onion<NS: Deref, L: Deref, CMH: Deref>(
320318
node_signer: NS, secp_ctx: &Secp256k1<secp256k1::All>, logger: L, custom_handler: CMH,
321319
msg: &msgs::OnionMessage,
322-
) -> Result<PeeledOnion<CMH>, ()>
320+
) -> Result<PeeledOnion<<<CMH>::Target as CustomOnionMessageHandler>::CustomMessage>, ()>
323321
where
324322
NS::Target: NodeSigner,
325323
L::Target: Logger,

0 commit comments

Comments
 (0)