Expose LND's other macaroon if possible

This commit is contained in:
nicolas.dorier
2018-12-20 16:52:04 +09:00
parent 57324345ac
commit e80593fb7b
5 changed files with 117 additions and 30 deletions

View File

@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using NBitcoin;
using NBitcoin.DataEncoders;
namespace BTCPayServer.Services
{
@@ -27,9 +28,9 @@ namespace BTCPayServer.Services
private void CleanExpired()
{
foreach(var item in _Map)
foreach (var item in _Map)
{
if(item.Value.expiration < DateTimeOffset.UtcNow)
if (item.Value.expiration < DateTimeOffset.UtcNow)
{
_Map.TryRemove(item.Key, out var unused);
}
@@ -41,24 +42,29 @@ namespace BTCPayServer.Services
{
public List<object> Configurations { get; set; } = new List<object>();
}
public class LightningConfiguration
public class LNDConfiguration
{
public string ChainType { get; set; }
public string Type { get; set; }
public string CryptoCode { get; set; }
public string CertificateThumbprint { get; set; }
public string Macaroon { get; set; }
public string AdminMacaroon { get; set; }
public string ReadonlyMacaroon { get; set; }
public string InvoiceMacaroon { get; set; }
}
public class LightningConfiguration : LNDConfiguration
{
public string Host { get; set; }
public int Port { get; set; }
public bool SSL { get; set; }
public string CertificateThumbprint { get; set; }
public string Macaroon { get; set; }
}
public class LNDRestConfiguration
public class LNDRestConfiguration : LNDConfiguration
{
public string ChainType { get; set; }
public string Type { get; set; }
public string CryptoCode { get; set; }
public string Uri { get; set; }
public string Macaroon { get; set; }
public string CertificateThumbprint { get; set; }
}
}