mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-04-08 03:58:05 +02:00
rpcserver: disallow zero valued invoices
This commit is contained in:
parent
fce366894d
commit
5d655ea332
@ -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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user