Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/Miningcore/Blockchain/Ethereum/EthereumConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class EthereumConstants
public const decimal ByzantiumBlockReward = 3.0m;
public const decimal ConstantinopleReward = 2.0m;
public const decimal PinkchainReward = 1.0m;


public const int MinConfimations = 16;

Expand Down Expand Up @@ -62,14 +63,18 @@ public class MineOnliumConstants
{
public const decimal BaseRewardInitial = 2.0m;
}

public class PartyConstants
{
public const decimal BaseRewardInitial = .1m;
}

public enum EthereumNetworkType
{
Main = 1,
Ropsten = 3,
Callisto = 820,
MainPow = 10001,
PartyChain = 1773,
EtherOne = 4949,
PinkChain = 10100,
MineOnlium = 54321,
Expand All @@ -83,6 +88,7 @@ public enum GethChainType
Ropsten,
Callisto,
MainPow = 10001,
PartyChain = 1773,
EtherOne = 4949,
PinkChain = 10100,
MineOnlium = 54321,
Expand Down
11 changes: 9 additions & 2 deletions src/Miningcore/Blockchain/Ethereum/EthereumPayoutHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public async Task<Block[]> ClassifyBlocksAsync(IMiningPool pool, Block[] blocks,
var gasUsed = blockHashResponse.Response.GasUsed;

var burnedFee = (decimal) 0;
if(extraPoolConfig?.ChainTypeOverride == "Ethereum" || extraPoolConfig?.ChainTypeOverride == "Main" || extraPoolConfig?.ChainTypeOverride == "MainPow" || extraPoolConfig?.ChainTypeOverride == "PinkChain" || extraPoolConfig?.ChainTypeOverride == "EtherOne" || extraPoolConfig?.ChainTypeOverride == "MineOnlium")
if(extraPoolConfig?.ChainTypeOverride == "Ethereum" || extraPoolConfig?.ChainTypeOverride == "Main" || extraPoolConfig?.ChainTypeOverride == "MainPow" || extraPoolConfig?.ChainTypeOverride == "PinkChain" || extraPoolConfig?.ChainTypeOverride == "EtherOne" || extraPoolConfig?.ChainTypeOverride == "MineOnlium" || extraPoolConfig?.ChainTypeOverride == "PartyChain")
burnedFee = (baseGas * gasUsed / EthereumConstants.Wei);

block.Hash = blockHash;
Expand Down Expand Up @@ -242,7 +242,7 @@ public async Task PayoutAsync(IMiningPool pool, Balance[] balances, Cancellation
// ensure we have peers
var infoResponse = await rpcClient.ExecuteAsync<string>(logger, EC.GetPeerCount, ct);

if((networkType == EthereumNetworkType.Main || networkType == EthereumNetworkType.MainPow || extraPoolConfig?.ChainTypeOverride == "PinkChain" || extraPoolConfig?.ChainTypeOverride == "EtherOne" || extraPoolConfig?.ChainTypeOverride == "MineOnlium") &&
if((networkType == EthereumNetworkType.Main || networkType == EthereumNetworkType.MainPow || extraPoolConfig?.ChainTypeOverride == "PinkChain" || extraPoolConfig?.ChainTypeOverride == "EtherOne" || extraPoolConfig?.ChainTypeOverride == "MineOnlium" || extraPoolConfig?.ChainTypeOverride == "PartyChain") &&
(infoResponse.Error != null || string.IsNullOrEmpty(infoResponse.Response) ||
infoResponse.Response.IntegralFromHex<int>() < EthereumConstants.MinPayoutPeerCount))
{
Expand Down Expand Up @@ -332,6 +332,9 @@ internal static decimal GetBaseBlockReward(GethChainType chainType, ulong height
case GethChainType.PinkChain:
return PinkConstants.BaseRewardInitial;

case GethChainType.PartyChain:
return PartyConstants.BaseRewardInitial;

default:
throw new Exception("Unable to determine block reward: Unsupported chain type");
}
Expand Down Expand Up @@ -429,6 +432,8 @@ private async Task<string> PayoutAsync(Balance balance, CancellationToken ct)
response = await rpcClient.ExecuteAsync<string>(logger, EC.SendTx, ct, new[] { requestPink });
}



else if(extraPoolConfig?.ChainTypeOverride == "MineOnlium")
{
var requestMineonlium = new SendTransactionRequestMineonlium
Expand All @@ -442,6 +447,8 @@ private async Task<string> PayoutAsync(Balance balance, CancellationToken ct)
};
response = await walletClient.ExecuteAsync<string>(logger, EC.SendTx, ct, new[] { requestMineonlium });
}


else {
response = await rpcClient.ExecuteAsync<string>(logger, EC.SendTx, ct, new[] { request });
}
Expand Down