Update EthereumPayoutHandler.cs
Start of EthOne and PinkChain integration
@@ -125,7 +125,7 @@ public class EthereumPayoutHandler : PayoutHandlerBase,
var gasUsed = blockHashResponse.Response.GasUsed;
var burnedFee = (decimal) 0;
- if(extraPoolConfig?.ChainTypeOverride == "Ethereum" || extraPoolConfig?.ChainTypeOverride == "MainPow")
+ if(extraPoolConfig?.ChainTypeOverride == "Ethereum" || extraPoolConfig?.ChainTypeOverride == "MainPow" || extraPoolConfig?.ChainTypeOverride == "EtherOne" || extraPoolConfig?.ChainTypeOverride == "Pink")
burnedFee = (baseGas * gasUsed / EthereumConstants.Wei);
block.Hash = blockHash;
@@ -237,7 +237,7 @@ public class EthereumPayoutHandler : PayoutHandlerBase,
// ensure we have peers
var infoResponse = await rpcClient.ExecuteAsync<string>(logger, EC.GetPeerCount, ct);
- if((networkType == EthereumNetworkType.Main || networkType == EthereumNetworkType.MainPow) &&
+ if((networkType == EthereumNetworkType.Main || networkType == EthereumNetworkType.MainPow || extraPoolConfig?.ChainTypeOverride == "EtherOne" || extraPoolConfig?.ChainTypeOverride == "Pink") &&
(infoResponse.Error != null || string.IsNullOrEmpty(infoResponse.Response) ||
infoResponse.Response.IntegralFromHex<int>() < EthereumConstants.MinPayoutPeerCount))
{
@@ -315,6 +315,12 @@ public class EthereumPayoutHandler : PayoutHandlerBase,
return EthereumConstants.HomesteadBlockReward;
+ case GethChainType.EtherOne:
+ return EthOneConstants.BaseRewardInitial;
+
+ case GethChainType.Pink:
+ return PinkConstants.BaseRewardInitial;
+
case GethChainType.Callisto:
return CallistoConstants.BaseRewardInitial * (CallistoConstants.TreasuryPercent / 100);
@@ -391,9 +397,10 @@ public class EthereumPayoutHandler : PayoutHandlerBase,
From = poolConfig.Address,
To = balance.Address,
Value = amount.ToString("x").TrimStart('0'),
+
};
- if(extraPoolConfig?.ChainTypeOverride == "Ethereum" || extraPoolConfig?.ChainTypeOverride == "MainPow")
+ if(extraPoolConfig?.ChainTypeOverride == "Ethereum" || extraPoolConfig?.ChainTypeOverride == "MainPow" || extraPoolConfig?.ChainTypeOverride == "EtherOne" || extraPoolConfig?.ChainTypeOverride == "Pink")
{
var maxPriorityFeePerGas = await rpcClient.ExecuteAsync<string>(logger, EC.MaxPriorityFeePerGas, ct);
request.Gas = extraConfig.Gas;
