mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2026-01-31 13:34:52 +01:00
fix nre on local coord
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
<PropertyGroup>
|
||||
<Product>Wabisabi Coinjoin</Product>
|
||||
<Description>Allows you to integrate your btcpayserver store with coinjoins.</Description>
|
||||
<Version>1.0.40</Version>
|
||||
<Version>1.0.41</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Plugin development properties -->
|
||||
|
||||
@@ -175,6 +175,11 @@ public class WabisabiCoordinatorService : PeriodicRunner
|
||||
_httpClientFactory);
|
||||
HostedServices.Register<WabiSabiCoordinator>(() => WabiSabiCoordinator, "WabiSabi Coordinator");
|
||||
var settings = await GetSettings();
|
||||
|
||||
if (settings.Enabled)
|
||||
{
|
||||
_ = StartCoordinator(cancellationToken);
|
||||
}
|
||||
if (settings.DiscoveredCoordinators?.Any() is true)
|
||||
{
|
||||
foreach (var discoveredCoordinator in settings.DiscoveredCoordinators)
|
||||
@@ -182,10 +187,6 @@ public class WabisabiCoordinatorService : PeriodicRunner
|
||||
_instanceManager.AddCoordinator(discoveredCoordinator.Name, discoveredCoordinator.Name, _ => discoveredCoordinator.Uri, null, discoveredCoordinator.Description );
|
||||
}
|
||||
}
|
||||
if (settings.Enabled)
|
||||
{
|
||||
_ = StartCoordinator(cancellationToken);
|
||||
}
|
||||
|
||||
await base.StartAsync(cancellationToken);
|
||||
}
|
||||
|
||||
@@ -92,13 +92,18 @@ public class WabisabiCoordinatorClientInstanceManager:IHostedService
|
||||
return;
|
||||
}
|
||||
|
||||
var url = fetcher.Invoke(_provider).AbsoluteUri;
|
||||
url = url.EndsWith("/")
|
||||
? url
|
||||
: url + "/";
|
||||
|
||||
var url = fetcher.Invoke(_provider)?.AbsoluteUri;
|
||||
if (url is not null)
|
||||
{
|
||||
url = url.EndsWith("/") is true
|
||||
? url
|
||||
: url + "/";
|
||||
}
|
||||
|
||||
var instance = new WabisabiCoordinatorClientInstance(
|
||||
displayName,
|
||||
name, new Uri(url), _provider.GetService<ILoggerFactory>(), _provider, UTXOLocker,
|
||||
name, url is null? null: new Uri(url), _provider.GetService<ILoggerFactory>(), _provider, UTXOLocker,
|
||||
_provider.GetService<WalletProvider>(), termsConditions, description);
|
||||
if (HostedServices.TryAdd(instance.CoordinatorName, instance))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user