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)
|
"(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{
|
i := &channeldb.Invoice{
|
||||||
CreationDate: time.Now(),
|
CreationDate: time.Now(),
|
||||||
Memo: []byte(invoice.Memo),
|
Memo: []byte(invoice.Memo),
|
||||||
|
Loading…
Reference in New Issue
Block a user