mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 01:43:50 +01:00
Do not register services of altcoins if not used
This commit is contained in:
parent
3fa694c65f
commit
9e2f7fb048
@ -492,6 +492,14 @@ namespace BTCPayServer
|
||||
ctx.Items["BTCPAY.APPDATA"] = appData;
|
||||
}
|
||||
|
||||
public static bool SupportChain(this IConfiguration conf, string cryptoCode)
|
||||
{
|
||||
var supportedChains = conf.GetOrDefault<string>("chains", "btc")
|
||||
.Split(',', StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(t => t.ToUpperInvariant()).ToHashSet();
|
||||
return supportedChains.Contains(cryptoCode.ToUpperInvariant());
|
||||
}
|
||||
|
||||
public static IActionResult RedirectToRecoverySeedBackup(this Controller controller, RecoverySeedBackupViewModel vm)
|
||||
{
|
||||
var redirectVm = new PostRedirectViewModel
|
||||
|
@ -88,7 +88,8 @@ namespace BTCPayServer.Hosting
|
||||
|
||||
services.AddPayJoinServices();
|
||||
#if ALTCOINS
|
||||
services.AddMoneroLike();
|
||||
if (configuration.SupportChain("xmr"))
|
||||
services.AddMoneroLike();
|
||||
#endif
|
||||
services.TryAddSingleton<SettingsRepository>();
|
||||
services.TryAddSingleton<ISettingsRepository>(provider => provider.GetService<SettingsRepository>());
|
||||
|
Loading…
Reference in New Issue
Block a user