Ensuding that payments are always ordered by time for consistency

This commit is contained in:
rockstardev 2018-12-18 11:56:51 -06:00
parent 7a9229628a
commit ec23eae21d

View File

@ -41,7 +41,7 @@ namespace BTCPayServer.Services.Invoices
public InvoiceRepository(ApplicationDbContextFactory contextFactory, string dbreezePath)
{
int retryCount = 0;
retry:
retry:
try
{
_Engine = new DBreezeEngine(dbreezePath);
@ -385,7 +385,8 @@ namespace BTCPayServer.Services.Invoices
var paymentEntity = ToObject<PaymentEntity>(p.Blob, null);
paymentEntity.Accounted = p.Accounted;
return paymentEntity;
}).ToList();
})
.OrderBy(a => a.ReceivedTime).ToList();
#pragma warning restore CS0618
var state = invoice.GetInvoiceState();
entity.ExceptionStatus = state.ExceptionStatus;