Support the new LN lib (#5422)

* Support the new LN lib

* fix test

* do not cache factories

* try without useless userinfo in lnd

* Remove monero wallet files

* support simpler DI too

---------

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
This commit is contained in:
Andrew Camilleri
2023-11-21 10:55:02 +01:00
committed by GitHub
parent 6d288271cd
commit 2f23bad3bc
27 changed files with 231 additions and 130 deletions

View File

@@ -156,7 +156,7 @@ namespace BTCPayServer.Controllers.Greenfield
.FirstOrDefault(d => d.PaymentId == id);
if (existing == null)
throw ErrorLightningNodeNotConfiguredForStore();
if (existing.GetExternalLightningUrl() is LightningConnectionString connectionString)
if (existing.GetExternalLightningUrl() is {} connectionString)
{
return Task.FromResult(_lightningClientFactory.Create(connectionString, network));
}
@@ -168,7 +168,7 @@ namespace BTCPayServer.Controllers.Greenfield
{
throw ErrorShouldBeAdminForInternalNode();
}
return Task.FromResult(_lightningClientFactory.Create(internalLightningNode, network));
return Task.FromResult(internalLightningNode);
}
throw ErrorLightningNodeNotConfiguredForStore();
}