Keep random generated Cryptonote instance id and just replace the fist byte with the user supplied value
@@ -627,15 +627,13 @@ namespace Miningcore.Blockchain.Cryptonote
{
instanceId = new byte[CryptonoteConstants.InstanceIdSize];
- if(clusterConfig.InstanceId.HasValue)
- instanceId[0] = clusterConfig.InstanceId.Value;
- else
- {
using(var rng = RandomNumberGenerator.Create())
{
rng.GetNonZeroBytes(instanceId);
}
- }
+
+ if(clusterConfig.InstanceId.HasValue)
+ instanceId[0] = clusterConfig.InstanceId.Value;
}
private void ConfigureRewards()
