// used anywhere.
max_total_routing_fee_msat: Option<u64>,
},
+ StaticInvoiceReceived {
+ payment_hash: PaymentHash,
+ keysend_preimage: PaymentPreimage,
+ retry_strategy: Retry,
+ payment_release_secret: [u8; 32],
+ route_params: RouteParameters,
+ },
Retryable {
retry_strategy: Option<Retry>,
attempts: PaymentAttempts,
PendingOutboundPayment::Legacy { .. } => None,
PendingOutboundPayment::AwaitingInvoice { .. } => None,
PendingOutboundPayment::InvoiceReceived { payment_hash, .. } => Some(*payment_hash),
+ PendingOutboundPayment::StaticInvoiceReceived { payment_hash, .. } => Some(*payment_hash),
PendingOutboundPayment::Retryable { payment_hash, .. } => Some(*payment_hash),
PendingOutboundPayment::Fulfilled { payment_hash, .. } => *payment_hash,
PendingOutboundPayment::Abandoned { payment_hash, .. } => Some(*payment_hash),
PendingOutboundPayment::Fulfilled { session_privs, .. } |
PendingOutboundPayment::Abandoned { session_privs, .. } => session_privs,
PendingOutboundPayment::AwaitingInvoice { .. } |
- PendingOutboundPayment::InvoiceReceived { .. } => { debug_assert!(false); return; },
+ PendingOutboundPayment::InvoiceReceived { .. } |
+ PendingOutboundPayment::StaticInvoiceReceived { .. } => { debug_assert!(false); return; },
});
let payment_hash = self.payment_hash();
*self = PendingOutboundPayment::Fulfilled { session_privs, payment_hash, timer_ticks_without_htlcs: 0 };
session_privs.remove(session_priv)
},
PendingOutboundPayment::AwaitingInvoice { .. } |
- PendingOutboundPayment::InvoiceReceived { .. } => { debug_assert!(false); false },
+ PendingOutboundPayment::InvoiceReceived { .. } |
+ PendingOutboundPayment::StaticInvoiceReceived { .. } => { debug_assert!(false); false },
};
if remove_res {
if let PendingOutboundPayment::Retryable {
session_privs.insert(session_priv)
},
PendingOutboundPayment::AwaitingInvoice { .. } |
- PendingOutboundPayment::InvoiceReceived { .. } => { debug_assert!(false); false },
+ PendingOutboundPayment::InvoiceReceived { .. } |
+ PendingOutboundPayment::StaticInvoiceReceived { .. } => { debug_assert!(false); false },
PendingOutboundPayment::Fulfilled { .. } => false,
PendingOutboundPayment::Abandoned { .. } => false,
};
},
PendingOutboundPayment::AwaitingInvoice { .. } => 0,
PendingOutboundPayment::InvoiceReceived { .. } => 0,
+ PendingOutboundPayment::StaticInvoiceReceived { .. } => 0,
}
}
}
debug_assert!(false);
return
},
+ PendingOutboundPayment::StaticInvoiceReceived { .. } => {
+ log_error!(logger, "Payment already initiating");
+ debug_assert!(false);
+ return
+ },
PendingOutboundPayment::Fulfilled { .. } => {
log_error!(logger, "Payment already completed");
return
(2, retry_strategy, required),
(4, max_total_routing_fee_msat, option),
},
+ // Added in 0.0.125. Prior versions will drop these outbounds on downgrade, which is safe because
+ // no HTLCs are in-flight.
+ (9, StaticInvoiceReceived) => {
+ (0, payment_hash, required),
+ (2, keysend_preimage, required),
+ (4, retry_strategy, required),
+ (6, payment_release_secret, required),
+ (8, route_params, required),
+ },
);
#[cfg(test)]