Fix: Invoice can't be paid in lightning anymore if lightning server sent error

This commit is contained in:
nicolas.dorier
2018-03-14 20:10:04 +09:00
parent 9e2e102ec4
commit b28b3ef4ff
2 changed files with 6 additions and 9 deletions

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<Version>1.0.1.48</Version>
<Version>1.0.1.49</Version>
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -60,9 +60,6 @@ namespace BTCPayServer.Payments.Lightning
private async Task EnsureListening(string invoiceId, bool poll)
{
if (Listening(invoiceId))
return;
var invoice = await _InvoiceRepository.GetInvoice(null, invoiceId);
foreach (var paymentMethod in invoice.GetPaymentMethods(_NetworkProvider)
.Where(c => c.GetId().PaymentType == PaymentTypes.LightningLike))
@@ -98,7 +95,10 @@ namespace BTCPayServer.Payments.Lightning
continue;
}
StartListening(listenedInvoice);
if (!Listening(invoiceId))
{
StartListening(listenedInvoice);
}
}
}
@@ -232,10 +232,7 @@ namespace BTCPayServer.Payments.Lightning
_ListeningLightning.Add(listen);
listen.ContinueWith(_ =>
{
lock (_ListenedInvoiceByLightningUrl)
{
_ListeningLightning.Remove(listen);
}
DoneListening(listenedInvoice);
}, TaskScheduler.Default);
}
_ListenedInvoiceByLightningUrl.Add(listenedInvoice.Uri, listenedInvoice);