From de41541ab3b081f7a6d5793dca1de545fe7c48b9 Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Thu, 16 Feb 2023 09:39:00 -0600 Subject: [PATCH] WIP: OffersMessageHandler impl for ChannelManager --- lightning/src/ln/channelmanager.rs | 2 +- lightning/src/onion_message/offers.rs | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index b2a23c7c1d4..8703697e06a 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -740,7 +740,7 @@ where our_network_pubkey: PublicKey, - inbound_payment_key: inbound_payment::ExpandedKey, + pub(crate) inbound_payment_key: inbound_payment::ExpandedKey, /// LDK puts the [fake scids] that it generates into namespaces, to identify the type of an /// incoming payment. To make it harder for a third-party to identify the type of a payment, diff --git a/lightning/src/onion_message/offers.rs b/lightning/src/onion_message/offers.rs index e8aeb037dae..205deb96c11 100644 --- a/lightning/src/onion_message/offers.rs +++ b/lightning/src/onion_message/offers.rs @@ -123,7 +123,16 @@ where R::Target: Router, L::Target: Logger, { - fn handle_message(&self, _message: OffersMessage) -> Option { + fn handle_message(&self, message: OffersMessage) -> Option { + match message { + OffersMessage::InvoiceRequest(invoice_request) => { + if invoice_request.verify(&self.inbound_payment_key) {} + }, + OffersMessage::Invoice(invoice) => { + if invoice.verify(&self.inbound_payment_key) {} + }, + OffersMessage::InvoiceError => {}, + } todo!() } }