mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Fix, macaroonfilepath should be read in order to create the qr code
This commit is contained in:
@@ -110,13 +110,14 @@ namespace BTCPayServer.Tests.Lnd
|
|||||||
var merchantInvoice = await InvoiceClient.CreateInvoice(10000, "Hello world", TimeSpan.FromSeconds(3600));
|
var merchantInvoice = await InvoiceClient.CreateInvoice(10000, "Hello world", TimeSpan.FromSeconds(3600));
|
||||||
|
|
||||||
await EnsureLightningChannelAsync();
|
await EnsureLightningChannelAsync();
|
||||||
var payResponse = await CustomerLnd.SendPaymentSyncAsync(new LnrpcSendRequest
|
|
||||||
{
|
|
||||||
Payment_request = merchantInvoice.BOLT11
|
|
||||||
});
|
|
||||||
|
|
||||||
await EventuallyAsync(async () =>
|
await EventuallyAsync(async () =>
|
||||||
{
|
{
|
||||||
|
var payResponse = await CustomerLnd.SendPaymentSyncAsync(new LnrpcSendRequest
|
||||||
|
{
|
||||||
|
Payment_request = merchantInvoice.BOLT11
|
||||||
|
});
|
||||||
|
|
||||||
var invoice = await InvoiceClient.GetInvoice(merchantInvoice.Id);
|
var invoice = await InvoiceClient.GetInvoice(merchantInvoice.Id);
|
||||||
Assert.True(invoice.PaidAt.HasValue);
|
Assert.True(invoice.PaidAt.HasValue);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ services:
|
|||||||
|
|
||||||
|
|
||||||
nbxplorer:
|
nbxplorer:
|
||||||
image: nicolasdorier/nbxplorer:1.0.2.8
|
image: nicolasdorier/nbxplorer:1.0.2.14
|
||||||
ports:
|
ports:
|
||||||
- "32838:32838"
|
- "32838:32838"
|
||||||
expose:
|
expose:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||||
<Version>1.0.2.57</Version>
|
<Version>1.0.2.58</Version>
|
||||||
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using BTCPayServer.Configuration;
|
using BTCPayServer.Configuration;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
using BTCPayServer.HostedServices;
|
using BTCPayServer.HostedServices;
|
||||||
using BTCPayServer.Models;
|
using BTCPayServer.Models;
|
||||||
using BTCPayServer.Models.ServerViewModels;
|
using BTCPayServer.Models.ServerViewModels;
|
||||||
@@ -331,9 +332,26 @@ namespace BTCPayServer.Controllers
|
|||||||
|
|
||||||
private LightningConnectionString GetExternalLNDConnectionString(string cryptoCode, int index)
|
private LightningConnectionString GetExternalLNDConnectionString(string cryptoCode, int index)
|
||||||
{
|
{
|
||||||
return _Options.ExternalServicesByCryptoCode.GetServices<ExternalLNDGRPC>(cryptoCode).Skip(index).Select(c => c.ConnectionString).FirstOrDefault();
|
var connectionString = _Options.ExternalServicesByCryptoCode.GetServices<ExternalLNDGRPC>(cryptoCode).Skip(index).Select(c => c.ConnectionString).FirstOrDefault();
|
||||||
|
if (connectionString == null)
|
||||||
|
return null;
|
||||||
|
connectionString = connectionString.Clone();
|
||||||
|
if(connectionString.MacaroonFilePath != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
connectionString.Macaroon = System.IO.File.ReadAllBytes(connectionString.MacaroonFilePath);
|
||||||
|
connectionString.MacaroonFilePath = null;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Logging.Logs.Configuration.LogWarning($"{cryptoCode}: The macaroon file path of the external LND grpc config was not found ({connectionString.MacaroonFilePath})");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return connectionString;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Route("server/theme")]
|
[Route("server/theme")]
|
||||||
public async Task<IActionResult> Theme()
|
public async Task<IActionResult> Theme()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -277,6 +277,13 @@ namespace BTCPayServer.Payments.Lightning
|
|||||||
connectionString = result;
|
connectionString = result;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LightningConnectionString Clone()
|
||||||
|
{
|
||||||
|
LightningConnectionString.TryParse(this.ToString(), false, out var result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private static string Take(Dictionary<string, string> keyValues, string key)
|
private static string Take(Dictionary<string, string> keyValues, string key)
|
||||||
{
|
{
|
||||||
if (keyValues.TryGetValue(key, out var v))
|
if (keyValues.TryGetValue(key, out var v))
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
"BTCPAY_CHAINS": "btc,ltc",
|
"BTCPAY_CHAINS": "btc,ltc",
|
||||||
"BTCPAY_BTCLIGHTNING": "type=charge;server=http://127.0.0.1:54938/;api-token=foiewnccewuify",
|
"BTCPAY_BTCLIGHTNING": "type=charge;server=http://127.0.0.1:54938/;api-token=foiewnccewuify",
|
||||||
"BTCPAY_BTCEXTERNALLNDGRPC": "type=lnd-rest;server=https://lnd:lnd@127.0.0.1:53280/;allowinsecure=true",
|
"BTCPAY_BTCEXTERNALLNDGRPC": "type=lnd-grpc;server=https://lnd:lnd@127.0.0.1:53280/;allowinsecure=true",
|
||||||
"BTCPAY_POSTGRES": "User ID=postgres;Host=127.0.0.1;Port=39372;Database=btcpayserver",
|
"BTCPAY_POSTGRES": "User ID=postgres;Host=127.0.0.1;Port=39372;Database=btcpayserver",
|
||||||
"BTCPAY_BUNDLEJSCSS": "false"
|
"BTCPAY_BUNDLEJSCSS": "false"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user