@@ -9124,22 +9124,19 @@ macro_rules! create_offer_builder { ($self: ident, $builder: ty) => {
9124
9124
let context = MessageContext::Offers (
9125
9125
OffersContext::InvoiceRequest { nonce }
9126
9126
);
9127
+
9128
+ let offer_builder = OfferBuilder::deriving_signing_pubkey(node_id, expanded_key, nonce, secp_ctx)
9129
+ .chain_hash($self.chain_hash);
9130
+
9127
9131
let builder = match blinded_path {
9128
9132
Some(blinded_path) => {
9129
9133
let paths = $self
9130
9134
.create_blinded_paths(context, blinded_path)
9131
9135
.map_err(|_| Bolt12SemanticError::MissingPaths)?;
9132
9136
9133
- let offer_builder = OfferBuilder::deriving_signing_pubkey(node_id, expanded_key, nonce, secp_ctx)
9134
- .chain_hash($self.chain_hash);
9135
-
9136
- paths.into_iter().fold(offer_builder, |builder, path| {
9137
- builder.path(path)
9138
- })
9137
+ paths.into_iter().fold(offer_builder, OfferBuilder::path)
9139
9138
}
9140
-
9141
- None => OfferBuilder::deriving_signing_pubkey(node_id, expanded_key, nonce, secp_ctx)
9142
- .chain_hash($self.chain_hash),
9139
+ None => offer_builder
9143
9140
};
9144
9141
9145
9142
Ok(builder.into())
@@ -9206,30 +9203,23 @@ macro_rules! create_refund_builder { ($self: ident, $builder: ty) => {
9206
9203
OffersContext::OutboundPayment { payment_id, nonce, hmac: None }
9207
9204
);
9208
9205
9206
+ let refund_builder = RefundBuilder::deriving_signing_pubkey(
9207
+ node_id, expanded_key, nonce, secp_ctx,
9208
+ amount_msats, payment_id,
9209
+ )?
9210
+ .chain_hash($self.chain_hash)
9211
+ .absolute_expiry(absolute_expiry);
9212
+
9209
9213
let builder = match blinded_path {
9210
9214
Some(blinded_path) => {
9211
9215
let paths = $self
9212
9216
.create_blinded_paths(context, blinded_path)
9213
9217
.map_err(|_| Bolt12SemanticError::MissingPaths)?;
9214
9218
9215
- let refund_builder = RefundBuilder::deriving_signing_pubkey(
9216
- node_id, expanded_key, nonce, secp_ctx,
9217
- amount_msats, payment_id,
9218
- )?
9219
- .chain_hash($self.chain_hash)
9220
- .absolute_expiry(absolute_expiry);
9221
-
9222
- paths.into_iter().fold(refund_builder, |builder, path| {
9223
- builder.path(path)
9224
- })
9219
+ paths.into_iter().fold(refund_builder, |builder, path| builder.path(path))
9225
9220
}
9226
9221
9227
- None => RefundBuilder::deriving_signing_pubkey(
9228
- node_id, expanded_key, nonce, secp_ctx,
9229
- amount_msats, payment_id,
9230
- )?
9231
- .chain_hash($self.chain_hash)
9232
- .absolute_expiry(absolute_expiry)
9222
+ None => refund_builder
9233
9223
};
9234
9224
9235
9225
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop($self);
0 commit comments