Skip to content

Commit 0c3a235

Browse files
committed
Add custom TLV support to PendingOutboundPayment for Bolt12 flows
Bolt11 payments now allow attaching custom TLVs to the onion packet, giving payers a way to pass metadata ranging from descriptions to custom authentication. Bolt12 lacked an equivalent path, leaving its outbound flow less extensible. This commit adds a `custom_tlvs` field to the Bolt12-related `PendingOutboundPayment` variants, bringing the internal Bolt12 payment state in line with the Bolt11 changes and preparing the ground for user-facing API support. A follow-up commit will expose a way for users to set these TLVs.
1 parent c1ae0ed commit 0c3a235

File tree

2 files changed

+78
-37
lines changed

2 files changed

+78
-37
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12888,7 +12888,7 @@ macro_rules! create_refund_builder { ($self: ident, $builder: ty) => {
1288812888
let expiration = StaleExpiration::AbsoluteTimeout(absolute_expiry);
1288912889
$self.pending_outbound_payments
1289012890
.add_new_awaiting_invoice(
12891-
payment_id, expiration, retry_strategy, route_params_config, None,
12891+
payment_id, vec![], expiration, retry_strategy, route_params_config, None,
1289212892
)
1289312893
.map_err(|_| Bolt12SemanticError::DuplicatePaymentId)?;
1289412894

@@ -12932,7 +12932,7 @@ macro_rules! create_refund_builder { ($self: ident, $builder: ty) => {
1293212932
let expiration = StaleExpiration::AbsoluteTimeout(absolute_expiry);
1293312933
$self.pending_outbound_payments
1293412934
.add_new_awaiting_invoice(
12935-
payment_id, expiration, retry_strategy, route_params_config, None,
12935+
payment_id, vec![], expiration, retry_strategy, route_params_config, None,
1293612936
)
1293712937
.map_err(|_| Bolt12SemanticError::DuplicatePaymentId)?;
1293812938

@@ -13054,6 +13054,7 @@ where
1305413054
self.pending_outbound_payments
1305513055
.add_new_awaiting_invoice(
1305613056
payment_id,
13057+
vec![],
1305713058
StaleExpiration::TimerTicks(1),
1305813059
optional_params.retry_strategy,
1305913060
optional_params.route_params_config,
@@ -13083,6 +13084,7 @@ where
1308313084
self.pending_outbound_payments
1308413085
.add_new_awaiting_invoice(
1308513086
payment_id,
13087+
vec![],
1308613088
StaleExpiration::TimerTicks(1),
1308713089
optional_params.retry_strategy,
1308813090
optional_params.route_params_config,
@@ -13125,6 +13127,7 @@ where
1312513127
self.pending_outbound_payments
1312613128
.add_new_awaiting_invoice(
1312713129
payment_id,
13130+
vec![],
1312813131
StaleExpiration::TimerTicks(1),
1312913132
optional_params.retry_strategy,
1313013133
optional_params.route_params_config,
@@ -13288,6 +13291,7 @@ where
1328813291
let expiration = StaleExpiration::TimerTicks(1);
1328913292
self.pending_outbound_payments.add_new_awaiting_offer(
1329013293
payment_id,
13294+
vec![],
1329113295
expiration,
1329213296
optional_params.retry_strategy,
1329313297
optional_params.route_params_config,

0 commit comments

Comments
 (0)