From 3804dbfab36a26cd91a41da39d5423c212be9cb4 Mon Sep 17 00:00:00 2001 From: "YQ.Hong" <60505593+yq0810@users.noreply.github.com> Date: Tue, 3 Jan 2023 16:28:02 +0800 Subject: [PATCH 1/2] fix uncle blokcs are orphaned fix uncle blokcs are orphaned when block.ConfirmationProgress > 0.75 --- .../Blockchain/Ethereum/EthereumPayoutHandler.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Miningcore/Blockchain/Ethereum/EthereumPayoutHandler.cs b/src/Miningcore/Blockchain/Ethereum/EthereumPayoutHandler.cs index 159a30873..8ce314d7c 100644 --- a/src/Miningcore/Blockchain/Ethereum/EthereumPayoutHandler.cs +++ b/src/Miningcore/Blockchain/Ethereum/EthereumPayoutHandler.cs @@ -158,6 +158,7 @@ public async Task ClassifyBlocksAsync(IMiningPool pool, Block[] blocks, // execute batch var blockInfo2s = await FetchBlocks(blockCache, ct, range.ToArray()); + var matchUncle = false; foreach(var blockInfo2 in blockInfo2s) { @@ -212,13 +213,19 @@ public async Task ClassifyBlocksAsync(IMiningPool pool, Block[] blocks, messageBus.NotifyBlockUnlocked(poolConfig.Id, block, coin); } - else + else { + matchUncle = false; logger.Info(() => $"[{LogCategory}] Got immature matching uncle for block {blockInfo2.Height.Value}. Will try again."); + } break; } } } + + if (matchUncle) + continue; + if(block.Status == BlockStatus.Pending && block.ConfirmationProgress > 0.75) { From 067f15015cd3a55ed8d95a264ecbbb3b0d2fc555 Mon Sep 17 00:00:00 2001 From: "YQ.Hong" Date: Fri, 13 Jan 2023 11:46:16 +0800 Subject: [PATCH 2/2] Update EthereumPayoutHandler.cs fix matchUncle --- src/Miningcore/Blockchain/Ethereum/EthereumPayoutHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Miningcore/Blockchain/Ethereum/EthereumPayoutHandler.cs b/src/Miningcore/Blockchain/Ethereum/EthereumPayoutHandler.cs index 8ce314d7c..984649066 100644 --- a/src/Miningcore/Blockchain/Ethereum/EthereumPayoutHandler.cs +++ b/src/Miningcore/Blockchain/Ethereum/EthereumPayoutHandler.cs @@ -214,7 +214,7 @@ public async Task ClassifyBlocksAsync(IMiningPool pool, Block[] blocks, } else { - matchUncle = false; + matchUncle = true; logger.Info(() => $"[{LogCategory}] Got immature matching uncle for block {blockInfo2.Height.Value}. Will try again."); }