Lightning Network support implementation

This commit is contained in:
nicolas.dorier
2018-02-26 00:48:12 +09:00
parent 3d33ecf397
commit c8923af573
40 changed files with 2580 additions and 408 deletions

View File

@@ -363,7 +363,7 @@ namespace BTCPayServer.Services.Invoices
{
entity.AvailableAddressHashes = invoice.AddressInvoices.Select(a => a.GetAddress() + a.GetpaymentMethodId().ToString()).ToHashSet();
}
if(invoice.Events != null)
if (invoice.Events != null)
{
entity.Events = invoice.Events.OrderBy(c => c.Timestamp).ToList();
}
@@ -461,7 +461,7 @@ namespace BTCPayServer.Services.Invoices
AddToTextSearch(invoiceId, addresses.Select(a => a.ToString()).ToArray());
}
public async Task<PaymentEntity> AddPayment(string invoiceId, DateTimeOffset date, CryptoPaymentData paymentData, string cryptoCode)
public async Task<PaymentEntity> AddPayment(string invoiceId, DateTimeOffset date, CryptoPaymentData paymentData, string cryptoCode, bool accounted = false)
{
using (var context = _ContextFactory.CreateContext())
{
@@ -471,17 +471,17 @@ namespace BTCPayServer.Services.Invoices
CryptoCode = cryptoCode,
#pragma warning restore CS0618
ReceivedTime = date.UtcDateTime,
Accounted = false
Accounted = accounted
};
entity.SetCryptoPaymentData(paymentData);
PaymentData data = new PaymentData
{
Id = paymentData.GetPaymentId(),
Blob = ToBytes(entity, null),
InvoiceDataId = invoiceId,
Accounted = false
Accounted = accounted
};
context.Payments.Add(data);