Do not require monero wallet daemon config if payment processing is disabled
@@ -204,6 +204,8 @@ namespace MiningCore.Blockchain.Monero
.Where(x => string.IsNullOrEmpty(x.Category))
.ToArray();
+ if (clusterConfig.PaymentProcessing?.Enabled == true && poolConfig.PaymentProcessing?.Enabled == true)
+ {
// extract wallet daemon endpoints
walletDaemonEndpoints = poolConfig.Daemons
.Where(x => x.Category?.ToLower() == MoneroConstants.WalletDaemonCategory)
@@ -211,6 +213,7 @@ namespace MiningCore.Blockchain.Monero
if (walletDaemonEndpoints.Length == 0)
logger.ThrowLogPoolStartupException("Wallet-RPC daemon is not configured (Daemon configuration for monero-pools require an additional entry of category \'wallet' pointing to the wallet daemon)", LogCat);
+ }
ConfigureDaemons();
}
@@ -322,10 +325,13 @@ namespace MiningCore.Blockchain.Monero
daemon = new DaemonClient(jsonSerializerSettings);
daemon.Configure(daemonEndpoints, MoneroConstants.DaemonRpcLocation);
+ if (clusterConfig.PaymentProcessing?.Enabled == true && poolConfig.PaymentProcessing?.Enabled == true)
+ {
// also setup wallet daemon
walletDaemon = new DaemonClient(jsonSerializerSettings);
walletDaemon.Configure(walletDaemonEndpoints, MoneroConstants.DaemonRpcLocation);
}
+ }
protected override async Task<bool> AreDaemonsHealthyAsync()
{
@@ -340,6 +346,8 @@ namespace MiningCore.Blockchain.Monero
if (!responses.All(x => x.Error == null))
return false;
+ if (clusterConfig.PaymentProcessing?.Enabled == true && poolConfig.PaymentProcessing?.Enabled == true)
+ {
// test wallet daemons
var responses2 = await walletDaemon.ExecuteCmdAllAsync<object>(MWC.GetAddress);
@@ -351,6 +359,9 @@ namespace MiningCore.Blockchain.Monero
return responses2.All(x => x.Error == null);
}
+ return true;
+ }
+
protected override async Task<bool> AreDaemonsConnectedAsync()
{
var response = await daemon.ExecuteCmdAnyAsync<GetInfoResponse>(MC.GetInfo);
@@ -398,14 +409,18 @@ namespace MiningCore.Blockchain.Monero
protected override async Task PostStartInitAsync()
{
var infoResponse = await daemon.ExecuteCmdAnyAsync(MC.GetInfo);
- var addressResponse = await walletDaemon.ExecuteCmdAnyAsync<GetAddressResponse>(MWC.GetAddress);
if (infoResponse.Error != null)
logger.ThrowLogPoolStartupException($"Init RPC failed: {infoResponse.Error.Message} (Code {infoResponse.Error.Code})", LogCat);
+ if (clusterConfig.PaymentProcessing?.Enabled == true && poolConfig.PaymentProcessing?.Enabled == true)
+ {
+ var addressResponse = await walletDaemon.ExecuteCmdAnyAsync<GetAddressResponse>(MWC.GetAddress);
+
// ensure pool owns wallet
if (clusterConfig.PaymentProcessing?.Enabled == true && addressResponse.Response?.Address != poolConfig.Address)
logger.ThrowLogPoolStartupException($"Wallet-Daemon does not own pool-address '{poolConfig.Address}'", LogCat);
+ }
var info = infoResponse.Response.ToObject<GetInfoResponse>();
