Fix: DateTime passed to bitpay API weren't assumed UTC, remove DateTime.Now references (#3206)

This commit is contained in:
Nicolas Dorier
2021-12-17 15:31:06 +09:00
committed by GitHub
parent 6de4f6a3ac
commit 163d1a195d
12 changed files with 57 additions and 13 deletions

View File

@@ -69,7 +69,7 @@ namespace BTCPayServer.Services.Apps
lastResetDate = settings.StartDate.Value;
nextResetDate = lastResetDate.Value;
while (DateTime.Now >= nextResetDate)
while (DateTime.UtcNow >= nextResetDate)
{
lastResetDate = nextResetDate;
switch (resetEvery)
@@ -171,7 +171,7 @@ namespace BTCPayServer.Services.Apps
TotalContributors = paidInvoices.Length,
ProgressPercentage = (currentPayments.TotalCurrency / settings.TargetAmount) * 100,
PendingProgressPercentage = (pendingPayments.TotalCurrency / settings.TargetAmount) * 100,
LastUpdated = DateTime.Now,
LastUpdated = DateTime.UtcNow,
PaymentStats = currentPayments.ToDictionary(c => c.Key.ToString(), c => c.Value.Value),
PendingPaymentStats = pendingPayments.ToDictionary(c => c.Key.ToString(), c => c.Value.Value),
LastResetDate = lastResetDate,