mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
Fix bug of address parsing for lightning
This commit is contained in:
parent
9f734349da
commit
030cb09af8
3 changed files with 10 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
|||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<Version>1.0.1.39</Version>
|
||||
<Version>1.0.1.40</Version>
|
||||
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -5,11 +5,18 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace BTCPayServer.Payments.Lightning.CLightning
|
||||
{
|
||||
//[{"type":"ipv4","address":"52.166.90.122","port":9735}]
|
||||
public class GetInfoResponse
|
||||
{
|
||||
public class GetInfoAddress
|
||||
{
|
||||
public string Type { get; set; }
|
||||
public string Address { get; set; }
|
||||
public int Port { get; set; }
|
||||
}
|
||||
public string Id { get; set; }
|
||||
public int Port { get; set; }
|
||||
public string[] Address { get; set; }
|
||||
public GetInfoAddress[] Address { get; set; }
|
||||
public string Version { get; set; }
|
||||
public int BlockHeight { get; set; }
|
||||
public string Network { get; set; }
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace BTCPayServer.Payments.Lightning
|
|||
{
|
||||
throw new Exception($"Error while connecting to the lightning charge {client.Uri} ({ex.Message})");
|
||||
}
|
||||
var address = info.Address?.FirstOrDefault();
|
||||
var address = info.Address.Select(a=>a.Address).FirstOrDefault();
|
||||
var port = info.Port;
|
||||
address = address ?? client.Uri.DnsSafeHost;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue