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

Commit

Permalink
Dev (#144)
Browse files Browse the repository at this point in the history
* rename BCC to BCH (#127)
* Electroneum Support (ETN)
* Lyra Hashrate Multiplier
* STAK hashrate fix
* Change API to align with latest wiki docs
* Added Electroneum in README
* Improved Monero transfer failure handling
* Do not emit UTF-8 BOM in Api responses (Fixes #124)
* cleanup masternode code for straks (#140)
  • Loading branch information
Oliver Weichhold authored Jan 2, 2018
1 parent ea70813 commit 44bc44f
Show file tree
Hide file tree
Showing 21 changed files with 506 additions and 441 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Namecoin | Yes | No | |
Viacoin | Yes | No | |
Peercoin | Yes | No | |
Straks | Yes | Yes | |
Electroneum | Yes | No | |
#### Ethereum

Miningcore implements the [Ethereum stratum mining protocol](https://github.com/nicehash/Specifications/blob/master/EthereumStratum_NiceHash_v1.0.0.txt) authored by NiceHash. This protocol is implemented by all major Ethereum miners.
Expand Down
3 changes: 2 additions & 1 deletion src/MiningCore/Api/ApiServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public ApiServer(
private readonly List<IMiningPool> pools = new List<IMiningPool>();
private IWebHost webHost;
private static readonly ILogger logger = LogManager.GetCurrentClassLogger();
private static readonly Encoding encoding = new UTF8Encoding(false);

private static readonly JsonSerializer serializer = new JsonSerializer
{
Expand All @@ -120,7 +121,7 @@ private async Task SendJson(HttpContext context, object response)

using (var stream = context.Response.Body)
{
using (var writer = new StreamWriter(stream, Encoding.UTF8))
using (var writer = new StreamWriter(stream, encoding))
{
serializer.Serialize(writer, response);

Expand Down
16 changes: 14 additions & 2 deletions src/MiningCore/Api/Responses/GetMinerStatsResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,29 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

using System;
using MiningCore.Persistence.Model;
using System.Collections.Generic;

namespace MiningCore.Api.Responses
{
public class WorkerPerformanceStats
{
public double Hashrate { get; set; }
public double SharesPerSecond { get; set; }
}

public class WorkerPerformanceStatsContainer
{
public DateTime Created { get; set; }
public Dictionary<string, WorkerPerformanceStats> Workers { get; set; }
}

public class MinerStats
{
public ulong PendingShares { get; set; }
public decimal PendingBalance { get; set; }
public decimal TotalPaid { get; set; }
public DateTime? LastPayment { get; set; }
public string LastPaymentLink { get; set; }
public MinerWorkerPerformanceStats[] PerformanceStats { get; set; }
public WorkerPerformanceStatsContainer Performance { get; set; }
}
}
3 changes: 3 additions & 0 deletions src/MiningCore/AutoMapperProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public AutoMapperProfile()
.ForMember(dest => dest.LastPayment, opt => opt.Ignore())
.ForMember(dest => dest.LastPaymentLink, opt => opt.Ignore());

CreateMap<WorkerPerformanceStats, Api.Responses.WorkerPerformanceStats>();
CreateMap<WorkerPerformanceStatsContainer, Api.Responses.WorkerPerformanceStatsContainer>();

// PostgreSQL
CreateMap<Share, Persistence.Postgres.Entities.Share>();
CreateMap<Block, Persistence.Postgres.Entities.Block>();
Expand Down
7 changes: 4 additions & 3 deletions src/MiningCore/Blockchain/Bitcoin/BitcoinPayoutHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
namespace MiningCore.Blockchain.Bitcoin
{
[CoinMetadata(
CoinType.BTC, CoinType.BCC, CoinType.NMC, CoinType.PPC,
CoinType.BTC, CoinType.BCH, CoinType.NMC, CoinType.PPC,
CoinType.LTC, CoinType.DOGE, CoinType.DGB, CoinType.VIA,
CoinType.GRS, CoinType.MONA, CoinType.VTC,
CoinType.BTG, CoinType.GLT, CoinType.STAK)]
Expand Down Expand Up @@ -178,6 +178,7 @@ public virtual async Task<Block[]> ClassifyBlocksAsync(Block[] blocks)
logger.Info(() => $"[{LogCategory}] Block {block.BlockHeight} classified as orphaned. Category: {transactionInfo.Details[0].Category}");

block.Status = BlockStatus.Orphaned;
block.Reward = 0;
result.Add(block);
break;
}
Expand Down Expand Up @@ -241,7 +242,7 @@ public virtual async Task PayoutAsync(Balance[] balances)

args = new object[]
{
string.Empty, // default account
string.Empty, // default account
amounts, // addresses and associated amounts
1, // only spend funds covered by this many confirmations
comment, // tx comment
Expand All @@ -253,7 +254,7 @@ public virtual async Task PayoutAsync(Balance[] balances)
{
args = new object[]
{
string.Empty, // default account
string.Empty, // default account
amounts, // addresses and associated amounts
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/MiningCore/Blockchain/Bitcoin/BitcoinPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
namespace MiningCore.Blockchain.Bitcoin
{
[CoinMetadata(
CoinType.BTC, CoinType.BCC, CoinType.NMC, CoinType.PPC,
CoinType.BTC, CoinType.BCH, CoinType.NMC, CoinType.PPC,
CoinType.LTC, CoinType.DOGE, CoinType.DGB, CoinType.VIA,
CoinType.GRS, CoinType.MONA, CoinType.VTC, CoinType.GLT)]
public class BitcoinPool : BitcoinPoolBase<BitcoinJob<BlockTemplate>, BlockTemplate>
Expand Down
Loading

0 comments on commit 44bc44f

Please sign in to comment.