mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Make sure a too high expiration do not trigger "The value needs to translate in milliseconds to -1 (signifying an infinite timeout)"
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||||
<Version>1.0.1.75</Version>
|
<Version>1.0.1.76</Version>
|
||||||
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -209,16 +209,16 @@ namespace BTCPayServer.HostedServices
|
|||||||
var invoice = await _InvoiceRepository.GetInvoice(null, invoiceId);
|
var invoice = await _InvoiceRepository.GetInvoice(null, invoiceId);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var now = DateTimeOffset.UtcNow;
|
var delay = invoice.ExpirationTime - DateTimeOffset.UtcNow;
|
||||||
if (invoice.ExpirationTime > now)
|
if (delay > TimeSpan.Zero)
|
||||||
{
|
{
|
||||||
await Task.Delay(invoice.ExpirationTime - now, _Cts.Token);
|
await Task.Delay(delay, _Cts.Token);
|
||||||
}
|
}
|
||||||
Watch(invoiceId);
|
Watch(invoiceId);
|
||||||
now = DateTimeOffset.UtcNow;
|
delay = invoice.MonitoringExpiration - DateTimeOffset.UtcNow;
|
||||||
if (invoice.MonitoringExpiration > now)
|
if (delay > TimeSpan.Zero)
|
||||||
{
|
{
|
||||||
await Task.Delay(invoice.MonitoringExpiration - now, _Cts.Token);
|
await Task.Delay(delay, _Cts.Token);
|
||||||
}
|
}
|
||||||
Watch(invoiceId);
|
Watch(invoiceId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ namespace BTCPayServer.Models.StoreViewModels
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Display(Name = "Invoice expires if the full amount has not been paid after ... minutes")]
|
[Display(Name = "Invoice expires if the full amount has not been paid after ... minutes")]
|
||||||
[Range(1, 60 * 24 * 31)]
|
[Range(1, 60 * 24 * 24)]
|
||||||
public int InvoiceExpiration
|
public int InvoiceExpiration
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
@@ -72,7 +72,7 @@ namespace BTCPayServer.Models.StoreViewModels
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Display(Name = "Payment invalid if transactions fails to confirm ... minutes after invoice expiration")]
|
[Display(Name = "Payment invalid if transactions fails to confirm ... minutes after invoice expiration")]
|
||||||
[Range(10, 60 * 24 * 31)]
|
[Range(10, 60 * 24 * 24)]
|
||||||
public int MonitoringExpiration
|
public int MonitoringExpiration
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
|
|||||||
Reference in New Issue
Block a user