Permalink
Browse files

Merge branch 'bug/error-downloading-miners'

  • Loading branch information...
nwoolls committed Mar 1, 2015
2 parents 3ddd4ac + 31aca8a commit 0245690719389e20e733f28613bab8ebde4cb71e
Showing with 9 additions and 4 deletions.
  1. +9 −4 MultiMiner.Engine/MinerFactory.cs
@@ -43,11 +43,16 @@ public MinerDescriptor GetMiner(DeviceKind deviceKind, CoinAlgorithm algorithm,
string algorithmName = algorithm.Name;
MinerDescriptor result = null;
if (miners.ContainsKey(algorithmName))
return Miners.Single(m => m.Name.Equals(miners[algorithmName], StringComparison.OrdinalIgnoreCase));
if (algorithm.DefaultMiner != null)
return Miners.Single(m => m.Name.Equals(algorithm.DefaultMiner, StringComparison.OrdinalIgnoreCase));
return null;
// SingleOrDefault - the user may have a config file with a backend
// miner registered that no longer exists in their Miners\ folder
result = Miners.SingleOrDefault(m => m.Name.Equals(miners[algorithmName], StringComparison.OrdinalIgnoreCase));
if ((result == null) && (algorithm.DefaultMiner != null))
result = Miners.Single(m => m.Name.Equals(algorithm.DefaultMiner, StringComparison.OrdinalIgnoreCase));
return result;
}
public MinerDescriptor GetMiner(DeviceKind deviceKind, string algorithmName, SerializableDictionary<string, string> miners)

0 comments on commit 0245690

Please sign in to comment.