Skip to content

Commit 4403787

Browse files
fixup! move the bolt12 invoice inside HTLCSource::OutboundRoute
Signed-off-by: Vincenzo Palazzo <[email protected]>
1 parent 5c25caf commit 4403787

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lightning/src/ln/channelmanager.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,9 @@ mod fuzzy_channelmanager {
668668
/// doing a double-pass on route when we get a failure back
669669
first_hop_htlc_msat: u64,
670670
payment_id: PaymentId,
671-
// TODO(vincenzopalazzo): add the documentation for this field
671+
/// The BOLT12 invoice associated with this payment, if any. This is stored here to ensure
672+
/// we can provide proof-of-payment details in payment claim events even after a restart
673+
/// with a stale ChannelManager state.
672674
bolt12_invoice: Option<PaidBolt12Invoice>,
673675
},
674676
}

lightning/src/ln/outbound_payment.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,6 @@ impl OutboundPayments {
10441044
hash_map::Entry::Occupied(entry) => match entry.get() {
10451045
PendingOutboundPayment::InvoiceReceived { .. } => {
10461046
let (retryable_payment, onion_session_privs) = Self::create_pending_payment(
1047-
// FIXME: remove the bolt12_invoice here! we need to clean up this part!
10481047
payment_hash, recipient_onion.clone(), keysend_preimage, None, Some(bolt12_invoice.clone()), &route,
10491048
Some(retry_strategy), payment_params, entropy_source, best_block_height,
10501049
);
@@ -1056,7 +1055,6 @@ impl OutboundPayments {
10561055
invoice_request
10571056
} else { unreachable!() };
10581057
let (retryable_payment, onion_session_privs) = Self::create_pending_payment(
1059-
// FIXME: We do not need anymore the bolt12_invoice here! we need to clean up this part!
10601058
payment_hash, recipient_onion.clone(), keysend_preimage, Some(invreq), Some(bolt12_invoice.clone()), &route,
10611059
Some(retry_strategy), payment_params, entropy_source, best_block_height
10621060
);
@@ -2067,7 +2065,6 @@ impl OutboundPayments {
20672065
let mut outbounds = self.pending_outbound_payments.lock().unwrap();
20682066
let mut pending_events = pending_events.lock().unwrap();
20692067
for source in sources {
2070-
// TODO(vincenzopalazzo): This should contain the paid bolt12 invoice.
20712068
if let HTLCSource::OutboundRoute { session_priv, payment_id, path, .. } = source {
20722069
let mut session_priv_bytes = [0; 32];
20732070
session_priv_bytes.copy_from_slice(&session_priv[..]);

0 commit comments

Comments
 (0)