Server hanging in debug mode if altcoin node is unavailable (#6545)

This commit is contained in:
Nicolas Dorier 2025-01-11 00:15:04 +09:00 committed by GitHub
parent e0a51537a1
commit 5a8c959b6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 5 deletions

View File

@ -31,7 +31,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="BTCPayServer.Lightning.Common" Version="1.5.2" />
<PackageReference Include="NBitcoin" Version="7.0.46" />
<PackageReference Include="NBitcoin" Version="7.0.48" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>

View File

@ -6,7 +6,7 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
<PackageReference Include="NBitcoin" Version="7.0.46" />
<PackageReference Include="NBitcoin" Version="7.0.48" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="DigitalRuby.ExchangeSharp" Version="1.2.0" />

View File

@ -33,7 +33,11 @@ namespace BTCPayServer.Services
if (liquid is not null)
{
var lbtcrpc = GetCashCow(liquid.CryptoCode);
await lbtcrpc.SendCommandAsync("rescanblockchain");
try
{
await lbtcrpc.SendCommandAsync("rescanblockchain");
}
catch { goto next; }
var elements = _prov.NetworkProviders.GetAll().OfType<Plugins.Altcoins.ElementsBTCPayNetwork>();
foreach (Plugins.Altcoins.ElementsBTCPayNetwork element in elements)
{
@ -50,8 +54,12 @@ namespace BTCPayServer.Services
}
}
}
await Task.WhenAll(_prov.GetAll().Select(o => o.Item2.RPCClient.ScanRPCCapabilitiesAsync()));
next:
try
{
await Task.WhenAll(_prov.GetAll().Select(o => o.Item2.RPCClient.ScanRPCCapabilitiesAsync()));
}
catch { }
}
Task IHostedService.StopAsync(CancellationToken cancellationToken)