Skip to content

Commit

Permalink
WIP: OffersMessageHandler impl for ChannelManager
Browse files Browse the repository at this point in the history
  • Loading branch information
jkczyz committed Feb 19, 2023
1 parent 55f09e1 commit de41541
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 10 additions & 1 deletion lightning/src/onion_message/offers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,16 @@ where
R::Target: Router,
L::Target: Logger,
{
fn handle_message(&self, _message: OffersMessage) -> Option<OffersMessage> {
fn handle_message(&self, message: OffersMessage) -> Option<OffersMessage> {
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!()
}
}
Expand Down

0 comments on commit de41541

Please sign in to comment.