rpcserver: add time_lock_delta overflow check

This commit is contained in:
Eval EXEC committed 2023-03-23 21:34:12 +08:00
1 parent 3dc4ab736f
commit cbcbddfe29
6 files changed
+48 -8

No files matched your search

+1 -1
View File
@@ -348,7 +348,7 @@ func AddInvoice(ctx context.Context, cfg *AddInvoiceConfig,
// We'll use our current default CLTV value unless one was specified as
// an option on the command line when creating an invoice.
switch {
case invoice.CltvExpiry > math.MaxUint16:
case invoice.CltvExpiry > routing.MaxCLTVDelta:
return nil, nil, fmt.Errorf("CLTV delta of %v is too large, "+
"max accepted is: %v", invoice.CltvExpiry,
math.MaxUint16)