diff --git a/BTCPayServer/Payments/Lightning/CLightning/CLightningRPCClient.cs b/BTCPayServer/Payments/Lightning/CLightning/CLightningRPCClient.cs index 00c32b84a..79f539a1b 100644 --- a/BTCPayServer/Payments/Lightning/CLightning/CLightningRPCClient.cs +++ b/BTCPayServer/Payments/Lightning/CLightning/CLightningRPCClient.cs @@ -177,7 +177,7 @@ namespace BTCPayServer.Payments.Lightning.CLightning async Task ILightningInvoiceClient.CreateInvoice(LightMoney amount, string description, TimeSpan expiry, CancellationToken cancellation) { var id = InvoiceIdEncoder.EncodeData(RandomUtils.GetBytes(20)); - var invoice = await SendCommandAsync("invoice", new object[] { amount.MilliSatoshi, id, description ?? "" }, cancellation: cancellation); + var invoice = await SendCommandAsync("invoice", new object[] { amount.MilliSatoshi, id, description ?? "", Math.Max(0, (int)expiry.TotalSeconds) }, cancellation: cancellation); invoice.Label = id; invoice.MilliSatoshi = amount; invoice.Status = "unpaid";