return Err(SendError::TooFewBlindedHops);
}
}
- let OnionMessageContents::Custom(ref msg) = message;
- if msg.tlv_type() < 64 { return Err(SendError::InvalidMessage) }
+
+ if message.tlv_type() < 64 { return Err(SendError::InvalidMessage) }
// If we are sending straight to a blinded path and we are the introduction node, we need to
// advance the blinded path by 1 hop so the second hop is the new introduction node.
impl<ES: Deref, NS: Deref, L: Deref, CMH: Deref> OnionMessageHandler for OnionMessenger<ES, NS, L, CMH>
where ES::Target: EntropySource,
NS::Target: NodeSigner,
- L::Target: Logger,
+ L::Target: Logger + Sized,
CMH::Target: CustomOnionMessageHandler + Sized,
{
/// Handle an incoming onion message. Currently, if a message was destined for us we will log, but
}
}
};
- match onion_utils::decode_next_untagged_hop(onion_decode_ss, &msg.onion_routing_packet.hop_data[..],
- msg.onion_routing_packet.hmac, (control_tlvs_ss, &*self.custom_handler))
- {
+ match onion_utils::decode_next_untagged_hop(
+ onion_decode_ss, &msg.onion_routing_packet.hop_data[..], msg.onion_routing_packet.hmac,
+ (control_tlvs_ss, &*self.custom_handler, &*self.logger)
+ ) {
Ok((Payload::Receive::<<<CMH as Deref>::Target as CustomOnionMessageHandler>::CustomMessage> {
message, control_tlvs: ReceiveControlTlvs::Unblinded(ReceiveTlvs { path_id }), reply_path,
}, None)) => {
"Received an onion message with path_id {:02x?} and {} reply_path",
path_id, if reply_path.is_some() { "a" } else { "no" });
match message {
+ OnionMessageContents::Offers(_msg) => todo!(),
OnionMessageContents::Custom(msg) => self.custom_handler.handle_custom_message(msg),
}
},
BIG_PACKET_HOP_DATA_LEN
} else { return Err(()) };
- Ok(onion_utils::construct_onion_message_packet::<_, _>(
- payloads, onion_keys, prng_seed, hop_data_len))
+ onion_utils::construct_onion_message_packet::<_, _>(
+ payloads, onion_keys, prng_seed, hop_data_len)
}