Fix: Test Connection for lightning setup was hidding cause of failure

This commit is contained in:
nicolas.dorier
2021-11-04 23:26:29 +09:00
parent 2afd02152d
commit c921b2ca7b
2 changed files with 3 additions and 3 deletions

View File

@@ -112,7 +112,7 @@ namespace BTCPayServer.Controllers
var handler = _ServiceProvider.GetRequiredService<LightningLikePaymentHandler>();
try
{
var info = await handler.GetNodeInfo(paymentMethod, network, new InvoiceLogs(), Request.IsOnion());
var info = await handler.GetNodeInfo(paymentMethod, network, new InvoiceLogs(), Request.IsOnion(), true);
if (!vm.SkipPortTest)
{
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(20));

View File

@@ -122,7 +122,7 @@ namespace BTCPayServer.Payments.Lightning
};
}
public async Task<NodeInfo[]> GetNodeInfo(LightningSupportedPaymentMethod supportedPaymentMethod, BTCPayNetwork network, InvoiceLogs invoiceLogs, bool? preferOnion = null)
public async Task<NodeInfo[]> GetNodeInfo(LightningSupportedPaymentMethod supportedPaymentMethod, BTCPayNetwork network, InvoiceLogs invoiceLogs, bool? preferOnion = null, bool throws=false)
{
if (!_Dashboard.IsFullySynched(network.CryptoCode, out var summary))
throw new PaymentMethodUnavailableException("Full node not available");
@@ -166,7 +166,7 @@ namespace BTCPayServer.Payments.Lightning
return nodeInfo;
}
}
catch(Exception e)
catch(Exception e) when (!throws)
{
invoiceLogs.Write($"NodeInfo failed to be fetched: {e.Message}", InvoiceEventData.EventSeverity.Error);
}