Skip to content

Commit

Permalink
Update create_offer_builder to use Bolt12CreationError
Browse files Browse the repository at this point in the history
Updated the create_offer_builder method in ChannelManager to
replace Bolt12SemanticError with Bolt12CreationError.
  • Loading branch information
slanesuke committed Jul 21, 2024
1 parent 28cecbb commit 397fa4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8672,15 +8672,15 @@ macro_rules! create_offer_builder { ($self: ident, $builder: ty) => {
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
pub fn create_offer_builder(
&$self, absolute_expiry: Option<Duration>
) -> Result<$builder, Bolt12SemanticError> {
) -> Result<$builder, Bolt12CreationError> {
let node_id = $self.get_our_node_id();
let expanded_key = &$self.inbound_payment_key;
let entropy = &*$self.entropy_source;
let secp_ctx = &$self.secp_ctx;

let path = $self.create_blinded_paths_using_absolute_expiry(OffersContext::Unknown {}, absolute_expiry)
.and_then(|paths| paths.into_iter().next().ok_or(()))
.map_err(|_| Bolt12SemanticError::MissingPaths)?;
.map_err(|_| Bolt12CreationError::InvalidSemantics(Bolt12SemanticError::MissingPaths))?;

let builder = OfferBuilder::deriving_signing_pubkey(
node_id, expanded_key, entropy, secp_ctx
Expand Down

0 comments on commit 397fa4b

Please sign in to comment.