mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-05 17:05:50 +02:00
channeldb/invoice: allow creating AMP invoices w/o preiamge
This commit is contained in:
@@ -719,7 +719,12 @@ func validateInvoice(i *Invoice, paymentHash lntypes.Hash) error {
|
||||
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")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user