channeldb/invoice: allow creating AMP invoices w/o preiamge
This commit is contained in:
parent
ea934e1be9
commit
cfa9e954c7
@ -719,7 +719,12 @@ func validateInvoice(i *Invoice, paymentHash lntypes.Hash) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if i.Terms.PaymentPreimage == nil && !i.HodlInvoice {
|
// AMP invoices and hodl invoices are allowed to have no preimage
|
||||||
|
// specified.
|
||||||
|
isAMP := i.Terms.Features.HasFeature(
|
||||||
|
lnwire.AMPOptional,
|
||||||
|
)
|
||||||
|
if i.Terms.PaymentPreimage == nil && !(i.HodlInvoice || isAMP) {
|
||||||
return errors.New("non-hodl invoices must have a preimage")
|
return errors.New("non-hodl invoices must have a preimage")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user