diff --git a/src/Miningcore/Blockchain/Ethereum/EthereumJobManager.cs b/src/Miningcore/Blockchain/Ethereum/EthereumJobManager.cs index d296c0569..8261aad7c 100644 --- a/src/Miningcore/Blockchain/Ethereum/EthereumJobManager.cs +++ b/src/Miningcore/Blockchain/Ethereum/EthereumJobManager.cs @@ -388,7 +388,7 @@ private JsonRpcRequest DeserializeRequest(byte[] data) #region API-Surface - public IObservable Jobs { get; private set; } + public IObservable Jobs { get; private set; } public override void Configure(PoolConfig poolConfig, ClusterConfig clusterConfig) { diff --git a/src/Miningcore/Blockchain/Ethereum/EthereumPool.cs b/src/Miningcore/Blockchain/Ethereum/EthereumPool.cs index dfda0a2f6..5044ee984 100644 --- a/src/Miningcore/Blockchain/Ethereum/EthereumPool.cs +++ b/src/Miningcore/Blockchain/Ethereum/EthereumPool.cs @@ -236,7 +236,7 @@ private async Task EnsureInitialWorkSent(StratumClient client) } } - protected virtual Task OnNewJobAsync(object jobParams) + protected virtual Task OnNewJobAsync(object[] jobParams) { currentJobParams = jobParams; @@ -266,8 +266,27 @@ protected virtual Task OnNewJobAsync(object jobParams) if (context.ApplyPendingDifficulty()) await client.NotifyAsync(EthereumStratumMethods.SetDifficulty, new object[] { context.Difficulty }); - // send job - await client.NotifyAsync(EthereumStratumMethods.MiningNotify, currentJobParams); + if (!context.IsEthminer) + { + // send job + await client.NotifyAsync(EthereumStratumMethods.MiningNotify, currentJobParams); + } + + else + { + // clone and patch jobparams + var tmpParams = new object[] + { + jobParams[0], + "0x" + jobParams[1], + "0x" + jobParams[2], + jobParams[3] + }; + + logger.Info("ethminer jobparams patch"); + + await client.NotifyAsync(EthereumStratumMethods.MiningNotify, tmpParams); + } } }); diff --git a/src/Miningcore/Blockchain/Ethereum/EthereumWorkerContext.cs b/src/Miningcore/Blockchain/Ethereum/EthereumWorkerContext.cs index 9909fe6d3..88147b10d 100644 --- a/src/Miningcore/Blockchain/Ethereum/EthereumWorkerContext.cs +++ b/src/Miningcore/Blockchain/Ethereum/EthereumWorkerContext.cs @@ -37,5 +37,7 @@ public class EthereumWorkerContext : WorkerContextBase public bool IsInitialWorkSent { get; set; } = false; public string ExtraNonce1 { get; set; } + + public bool IsEthminer => Miner?.ToLower().Contains("ethminer") == true; } }