mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-28 13:52:55 +02:00
rpcserver: disallow zero valued invoices
This commit is contained in:
@@ -945,6 +945,11 @@ func (r *rpcServer) AddInvoice(ctx context.Context,
|
||||
"(maxsize=%v)", len(invoice.Receipt), channeldb.MaxReceiptSize)
|
||||
}
|
||||
|
||||
// Finally, the value of an invoice MUST NOT be zero.
|
||||
if invoice.Value == 0 {
|
||||
return nil, fmt.Errorf("zero value invoices are disallowed")
|
||||
}
|
||||
|
||||
i := &channeldb.Invoice{
|
||||
CreationDate: time.Now(),
|
||||
Memo: []byte(invoice.Memo),
|
||||
|
Reference in New Issue
Block a user