Only initialize RandomX if internal stratum is actually enabled
@@ -118,6 +118,8 @@ namespace Miningcore.Blockchain.Cryptonote
{
logger.Info(()=> $"Detected new seed hash {blockTemplate.SeedHash} starting @ height {blockTemplate.Height}");
+ if(poolConfig.EnableInternalStratum == true)
+ {
LibRandomX.WithLock(() =>
{
// delete old seed
@@ -129,6 +131,7 @@ namespace Miningcore.Blockchain.Cryptonote
LibRandomX.CreateSeed(randomXRealm, currentSeedHash, randomXFlagsOverride, randomXFlagsAdd, extraPoolConfig.RandomXVMCount);
});
}
+ }
// init job
job = new CryptonoteJob(blockTemplate, instanceId, NextJobId(), coin, poolConfig, clusterConfig, newHash, randomXRealm);
@@ -262,9 +265,12 @@ namespace Miningcore.Blockchain.Cryptonote
extraPoolConfig = poolConfig.Extra.SafeExtensionDataAs<CryptonotePoolConfigExtra>();
coin = poolConfig.Template.As<CryptonoteCoinTemplate>();
+ if(poolConfig.EnableInternalStratum == true)
+ {
randomXRealm = poolConfig.Id;
randomXFlagsOverride = MakeRandomXFlags(extraPoolConfig.RandomXFlagsOverride);
randomXFlagsAdd = MakeRandomXFlags(extraPoolConfig.RandomXFlagsAdd);
+ }
// extract standard daemon endpoints
daemonEndpoints = poolConfig.Daemons
