Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
Change default DAG directory based on algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
ceedii committed Jan 30, 2023
1 parent 50a6584 commit f2747ba
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions src/Miningcore/Blockchain/Ethereum/EthereumJobManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -349,15 +349,34 @@ public override void Configure(PoolConfig pc, ClusterConfig cc)

if(pc.EnableInternalStratum == true)
{
var coin = pc.Template.As<EthereumCoinTemplate>();

// ensure dag location is configured
var dagDir = !string.IsNullOrEmpty(extraPoolConfig?.DagDir) ?
Environment.ExpandEnvironmentVariables(extraPoolConfig.DagDir) :
Dag.GetDefaultDagDirectory();
string dagDir = null;

if(!string.IsNullOrEmpty(extraPoolConfig?.DagDir))
{
dagDir = Environment.ExpandEnvironmentVariables(extraPoolConfig.DagDir);
}
else
{
// Default DAG folder
switch(coin.Symbol)
{
case "ETC":
dagDir = DagEtchash.GetDefaultDagDirectory();
break;
case "UBIQ":
dagDir = DagUbqhash.GetDefaultDagDirectory();
break;
default:
dagDir = Dag.GetDefaultDagDirectory();
break;
}
}

// create it if necessary
Directory.CreateDirectory(dagDir);

var coin = pc.Template.As<EthereumCoinTemplate>();

// setup ethash
switch(coin.Symbol)
Expand Down

0 comments on commit f2747ba

Please sign in to comment.