payment_secret: None, // only used for retries, and we'll never retry on startup
payment_metadata: None, // only used for retries, and we'll never retry on startup
keysend_preimage: None, // only used for retries, and we'll never retry on startup
+ custom_tlvs: Vec::new(), // only used for retries, and we'll never retry on startup
pending_amt_msat: path_amt,
pending_fee_msat: Some(path_fee),
total_msat: path_amt,
payment_secret: Option<PaymentSecret>,
payment_metadata: Option<Vec<u8>>,
keysend_preimage: Option<PaymentPreimage>,
+ custom_tlvs: Vec<(u64, Vec<u8>)>,
pending_amt_msat: u64,
/// Used to track the fee paid. Only present if the payment was serialized on 0.0.103+.
pending_fee_msat: Option<u64>,
hash_map::Entry::Occupied(mut payment) => {
let res = match payment.get() {
PendingOutboundPayment::Retryable {
- total_msat, keysend_preimage, payment_secret, payment_metadata, pending_amt_msat, ..
+ total_msat, keysend_preimage, payment_secret, payment_metadata,
+ custom_tlvs, pending_amt_msat, ..
} => {
let retry_amt_msat = route.get_total_amount();
if retry_amt_msat + *pending_amt_msat > *total_msat * (100 + RETRY_OVERFLOW_PERCENTAGE) / 100 {
(*total_msat, RecipientOnionFields {
payment_secret: *payment_secret,
payment_metadata: payment_metadata.clone(),
- custom_tlvs: Vec::new(),
+ custom_tlvs: custom_tlvs.clone(),
}, *keysend_preimage)
},
PendingOutboundPayment::Legacy { .. } => {
payment_secret: recipient_onion.payment_secret,
payment_metadata: recipient_onion.payment_metadata,
keysend_preimage,
+ custom_tlvs: recipient_onion.custom_tlvs,
starting_block_height: best_block_height,
total_msat: route.get_total_amount(),
});
(6, total_msat, required),
(7, payment_metadata, option),
(8, pending_amt_msat, required),
+ (9, custom_tlvs, optional_vec),
(10, starting_block_height, required),
(not_written, retry_strategy, (static_value, None)),
(not_written, attempts, (static_value, PaymentAttempts::new())),