From 8b79212a6e74fec74a1b5c1c3b316fc9aaec4e7c Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Wed, 26 Oct 2022 13:34:09 +0900 Subject: [PATCH] [Greenfield] Fix: The route to connect to a peer lightning node was always crashing --- BTCPayServer.Tests/GreenfieldAPITests.cs | 3 +++ BTCPayServer/BTCPayServer.csproj | 4 ++-- BTCPayServer/Hosting/BTCPayServerServices.cs | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/BTCPayServer.Tests/GreenfieldAPITests.cs b/BTCPayServer.Tests/GreenfieldAPITests.cs index 31f9a7855..be441952e 100644 --- a/BTCPayServer.Tests/GreenfieldAPITests.cs +++ b/BTCPayServer.Tests/GreenfieldAPITests.cs @@ -1675,6 +1675,9 @@ namespace BTCPayServer.Tests Assert.NotNull(info.InactiveChannelsCount); Assert.NotNull(info.PendingChannelsCount); + var gex = await AssertAPIError("lightning-node-unavailable", () => chargeClient.ConnectToLightningNode("BTC", new ConnectToNodeRequest(NodeInfo.Parse($"{new Key().PubKey.ToHex()}@localhost:3827")))); + Assert.Contains("NotSupported", gex.Message); + await AssertAPIError("lightning-node-unavailable", () => chargeClient.GetLightningNodeChannels("BTC")); // Not permission for the store! await AssertAPIError("missing-permission", () => chargeClient.GetLightningNodeChannels(user.StoreId, "BTC")); diff --git a/BTCPayServer/BTCPayServer.csproj b/BTCPayServer/BTCPayServer.csproj index afead83ea..4d36db9b7 100644 --- a/BTCPayServer/BTCPayServer.csproj +++ b/BTCPayServer/BTCPayServer.csproj @@ -1,4 +1,4 @@ - + @@ -41,7 +41,7 @@ - + diff --git a/BTCPayServer/Hosting/BTCPayServerServices.cs b/BTCPayServer/Hosting/BTCPayServerServices.cs index e7ec70c02..b3d776540 100644 --- a/BTCPayServer/Hosting/BTCPayServerServices.cs +++ b/BTCPayServer/Hosting/BTCPayServerServices.cs @@ -448,6 +448,7 @@ namespace BTCPayServer.Hosting services.AddSingleton(); services.SkipModelValidation(); + services.SkipModelValidation(); if (configuration.GetOrDefault("cheatmode", false)) {