Skip to content

Commit a27afc0

Browse files
TheBlueMattshaavan
authored andcommitted
Remove unused callback arg from construct_keys_for_onion_message
1 parent ba0ea9a commit a27afc0

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

lightning/src/blinded_path/utils.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,13 @@ pub(crate) fn construct_keys_for_onion_message<'a, T, I, F>(
113113
where
114114
T: secp256k1::Signing + secp256k1::Verification,
115115
I: Iterator<Item = PublicKey>,
116-
F: FnMut(PublicKey, SharedSecret, PublicKey, [u8; 32], Option<PublicKey>, Option<Vec<u8>>),
116+
F: FnMut(SharedSecret, PublicKey, [u8; 32], Option<PublicKey>, Option<Vec<u8>>),
117117
{
118-
build_keys_helper!(session_priv, secp_ctx, callback);
118+
let mut callback_wrapper =
119+
|_, ss, pk, encrypted_payload_rho, unblinded_hop_data, encrypted_payload| {
120+
callback(ss, pk, encrypted_payload_rho, unblinded_hop_data, encrypted_payload);
121+
};
122+
build_keys_helper!(session_priv, secp_ctx, callback_wrapper);
119123

120124
for pk in unblinded_path {
121125
build_keys_in_loop!(pk, false, None);

lightning/src/onion_message/messenger.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2283,12 +2283,7 @@ fn packet_payloads_and_keys<
22832283
unblinded_path.into_iter(),
22842284
destination,
22852285
session_priv,
2286-
|_,
2287-
onion_packet_ss,
2288-
ephemeral_pubkey,
2289-
control_tlvs_ss,
2290-
unblinded_pk_opt,
2291-
enc_payload_opt| {
2286+
|onion_packet_ss, ephemeral_pubkey, control_tlvs_ss, unblinded_pk_opt, enc_payload_opt| {
22922287
if num_unblinded_hops != 0 && unblinded_path_idx < num_unblinded_hops {
22932288
if let Some(ss) = prev_control_tlvs_ss.take() {
22942289
payloads.push((

0 commit comments

Comments
 (0)