From a42cf7a4dda5219a79730bacf87ba3d2a862178d Mon Sep 17 00:00:00 2001 From: Oliver Weichhold Date: Sun, 17 Jul 2022 13:56:33 +0200 Subject: [PATCH 1/2] Fix broken BTG payouts --- src/Miningcore/Blockchain/Bitcoin/BitcoinPayoutHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Miningcore/Blockchain/Bitcoin/BitcoinPayoutHandler.cs b/src/Miningcore/Blockchain/Bitcoin/BitcoinPayoutHandler.cs index 3240b660d..e22708761 100644 --- a/src/Miningcore/Blockchain/Bitcoin/BitcoinPayoutHandler.cs +++ b/src/Miningcore/Blockchain/Bitcoin/BitcoinPayoutHandler.cs @@ -205,7 +205,7 @@ public virtual async Task PayoutAsync(IMiningPool pool, Balance[] balances, Canc var comment = $"{identifier} Payment"; - if(!(extraPoolConfig?.HasBrokenSendMany == true || poolConfig.Template.As().HasBrokenSendMany)) + if(!(extraPoolConfig?.HasBrokenSendMany == true || poolConfig.Template is BitcoinTemplate { HasBrokenSendMany: true })) { if(extraPoolPaymentProcessingConfig?.MinersPayTxFees == true) { From c58a647b5eb9953ac6e1260ae63dcadf18c68506 Mon Sep 17 00:00:00 2001 From: Oliver Weichhold Date: Sun, 17 Jul 2022 14:13:00 +0200 Subject: [PATCH 2/2] Make Ergo network detection more reliable --- src/Miningcore/Blockchain/Ergo/ErgoJobManager.cs | 13 +++++++++---- src/Miningcore/Blockchain/Ergo/RPC/ErgoClient.cs | 4 ++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Miningcore/Blockchain/Ergo/ErgoJobManager.cs b/src/Miningcore/Blockchain/Ergo/ErgoJobManager.cs index 3427b66ed..2e1c5895d 100644 --- a/src/Miningcore/Blockchain/Ergo/ErgoJobManager.cs +++ b/src/Miningcore/Blockchain/Ergo/ErgoJobManager.cs @@ -364,11 +364,16 @@ protected override async Task PostStartInitAsync(CancellationToken ct) blockVersion = info.Parameters.BlockVersion; // chain detection - var m = ErgoConstants.RegexChain.Match(info.Name); - if(!m.Success) - throw new PoolStartupException($"Unable to identify network type ({info.Name}", poolConfig.Id); + if(!string.IsNullOrEmpty(info.Network)) + network = info.Network.ToLower(); + else + { + var m = ErgoConstants.RegexChain.Match(info.Name); + if(!m.Success) + throw new PoolStartupException($"Unable to identify network type ({info.Name}", poolConfig.Id); - network = m.Groups[1].Value.ToLower(); + network = m.Groups[1].Value.ToLower(); + } // Payment-processing setup if(clusterConfig.PaymentProcessing?.Enabled == true && poolConfig.PaymentProcessing?.Enabled == true) diff --git a/src/Miningcore/Blockchain/Ergo/RPC/ErgoClient.cs b/src/Miningcore/Blockchain/Ergo/RPC/ErgoClient.cs index b486a5880..711390a20 100644 --- a/src/Miningcore/Blockchain/Ergo/RPC/ErgoClient.cs +++ b/src/Miningcore/Blockchain/Ergo/RPC/ErgoClient.cs @@ -10897,6 +10897,10 @@ public partial class NodeInfo [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string Name { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("network", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string Network { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("appVersion", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string AppVersion { get; set; } = default!;