mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-23 15:14:49 +01:00
Fix bug about btcpay showing wrong port 0 as public lightning port for charge and clightning
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<Version>1.0.2.100</Version>
|
||||
<Version>1.0.2.101</Version>
|
||||
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -211,13 +211,21 @@ namespace BTCPayServer.Payments.Lightning.CLightning
|
||||
async Task<LightningNodeInformation> ILightningInvoiceClient.GetInfo(CancellationToken cancellation)
|
||||
{
|
||||
var info = await GetInfoAsync(cancellation);
|
||||
var address = info.Address.Select(a => a.Address).FirstOrDefault();
|
||||
var port = info.Port;
|
||||
var addr = info.Address.FirstOrDefault();
|
||||
if(addr == null)
|
||||
{
|
||||
addr = new Charge.GetInfoResponse.GetInfoAddress();
|
||||
addr.Address = "127.0.0.1";
|
||||
}
|
||||
if(addr.Port == 0)
|
||||
{
|
||||
addr.Port = 9735;
|
||||
}
|
||||
return new LightningNodeInformation()
|
||||
{
|
||||
NodeId = info.Id,
|
||||
P2PPort = port,
|
||||
Address = address,
|
||||
P2PPort = addr.Port,
|
||||
Address = addr.Address,
|
||||
BlockHeight = info.BlockHeight
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ namespace BTCPayServer.Payments.Lightning.Charge
|
||||
public int Port { get; set; }
|
||||
}
|
||||
public string Id { get; set; }
|
||||
public int Port { get; set; }
|
||||
public GetInfoAddress[] Address { get; set; }
|
||||
public string Version { get; set; }
|
||||
public int BlockHeight { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user