@@ -8883,15 +8883,21 @@ macro_rules! create_offer_builder { ($self: ident, $builder: ty) => {
8883
8883
let nonce = Nonce::from_entropy_source(entropy);
8884
8884
let context = OffersContext::InvoiceRequest { nonce };
8885
8885
8886
- let mut builder = OfferBuilder::deriving_signing_pubkey(node_id, expanded_key, nonce, secp_ctx)
8887
- .chain_hash($self.chain_hash);
8888
- if let Some(params) = params {
8889
- let path = $self .create_blinded_paths(params, context)
8890
- .and_then(|paths| paths.into_iter().next().ok_or(()))
8891
- .map_err(|_| Bolt12SemanticError::MissingPaths)?;
8886
+ let builder = match params {
8887
+ Some(params) => {
8888
+ let path = $self
8889
+ .create_blinded_paths(params, context)
8890
+ .and_then(|paths| paths.into_iter().next().ok_or(()))
8891
+ .map_err(|_| Bolt12SemanticError::MissingPaths)?;
8892
8892
8893
- builder = builder.path(path);
8894
- }
8893
+ OfferBuilder::deriving_signing_pubkey(node_id, expanded_key, nonce, secp_ctx)
8894
+ .chain_hash($self.chain_hash)
8895
+ .path(path)
8896
+ }
8897
+
8898
+ None => OfferBuilder::deriving_signing_pubkey(node_id, expanded_key, nonce, secp_ctx)
8899
+ .chain_hash($self.chain_hash),
8900
+ };
8895
8901
8896
8902
Ok(builder.into())
8897
8903
}
@@ -8956,18 +8962,28 @@ macro_rules! create_refund_builder { ($self: ident, $builder: ty) => {
8956
8962
let nonce = Nonce::from_entropy_source(entropy);
8957
8963
let context = OffersContext::OutboundPayment { payment_id, nonce, hmac: None };
8958
8964
8959
- let mut builder = RefundBuilder::deriving_payer_id(
8960
- node_id, expanded_key, nonce, secp_ctx, amount_msats, payment_id
8961
- )?
8962
- .chain_hash($self.chain_hash)
8963
- .absolute_expiry(absolute_expiry);
8965
+ let builder = match params {
8966
+ Some(params) => {
8967
+ let path = $self
8968
+ .create_blinded_paths(params, context)
8969
+ .and_then(|paths| paths.into_iter().next().ok_or(()))
8970
+ .map_err(|_| Bolt12SemanticError::MissingPaths)?;
8964
8971
8965
- if let Some(params) = params {
8966
- let path = $self.create_blinded_paths(params, context)
8967
- .and_then(|paths| paths.into_iter().next().ok_or(()))
8968
- .map_err(|_| Bolt12SemanticError::MissingPaths)?;
8972
+ RefundBuilder::deriving_payer_id(
8973
+ node_id, expanded_key, nonce, secp_ctx,
8974
+ amount_msats, payment_id,
8975
+ )?
8976
+ .chain_hash($self.chain_hash)
8977
+ .absolute_expiry(absolute_expiry)
8978
+ .path(path)
8979
+ }
8969
8980
8970
- builder = builder.path(path);
8981
+ None => RefundBuilder::deriving_payer_id(
8982
+ node_id, expanded_key, nonce, secp_ctx,
8983
+ amount_msats, payment_id,
8984
+ )?
8985
+ .chain_hash($self.chain_hash)
8986
+ .absolute_expiry(absolute_expiry),
8971
8987
};
8972
8988
8973
8989
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop($self);
0 commit comments