multi: make tlv onion compulsory

This commit is contained in:
Keagan McClelland committed 2024-01-11 09:43:31 -08:00
1 parent 9afe1b72dc
commit 239103c2b3
9 files changed
+29 -26

No files matched your search

+6 -6
View File
@@ -756,10 +756,10 @@ func (i *InvoiceRegistry) processKeySend(ctx invoiceUpdateCtx) error {
// Create an invoice for the htlc amount.
amt := ctx.amtPaid
// Set tlv optional feature vector on the invoice. Otherwise we wouldn't
// Set tlv required feature vector on the invoice. Otherwise we wouldn't
// be able to pay to it with keysend.
rawFeatures := lnwire.NewRawFeatureVector(
lnwire.TLVOnionPayloadOptional,
lnwire.TLVOnionPayloadRequired,
)
features := lnwire.NewFeatureVector(rawFeatures, lnwire.Features)
@@ -820,11 +820,11 @@ func (i *InvoiceRegistry) processAMP(ctx invoiceUpdateCtx) error {
// record.
amt := ctx.mpp.TotalMsat()
// Set the TLV and MPP optional features on the invoice. We'll also make
// the AMP features required so that it can't be paid by legacy or MPP
// htlcs.
// Set the TLV required and MPP optional features on the invoice. We'll
// also make the AMP features required so that it can't be paid by
// legacy or MPP htlcs.
rawFeatures := lnwire.NewRawFeatureVector(
lnwire.TLVOnionPayloadOptional,
lnwire.TLVOnionPayloadRequired,
lnwire.PaymentAddrOptional,
lnwire.AMPRequired,
)
+2 -2
View File
@@ -1460,7 +1460,7 @@ func TestSettleInvoicePaymentAddrRequired(t *testing.T) {
Expiry: time.Hour,
Features: lnwire.NewFeatureVector(
lnwire.NewRawFeatureVector(
lnwire.TLVOnionPayloadOptional,
lnwire.TLVOnionPayloadRequired,
lnwire.PaymentAddrRequired,
),
lnwire.Features,
@@ -1549,7 +1549,7 @@ func TestSettleInvoicePaymentAddrRequiredOptionalGrace(t *testing.T) {
Expiry: time.Hour,
Features: lnwire.NewFeatureVector(
lnwire.NewRawFeatureVector(
lnwire.TLVOnionPayloadOptional,
lnwire.TLVOnionPayloadRequired,
lnwire.PaymentAddrOptional,
),
lnwire.Features,