From 20380da70fd2fbcdeba7f9f9d68d3907f900eb58 Mon Sep 17 00:00:00 2001 From: Marko Date: Sun, 9 Jun 2024 22:32:49 +0200 Subject: [PATCH] xdc-0.9.2c fixed getMinSignerPowDifficulty() pre block 4200000 min diff handling --- IxianDLT/Block/BlockChain.cs | 9 ++++++++- IxianDLT/Meta/Config.cs | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/IxianDLT/Block/BlockChain.cs b/IxianDLT/Block/BlockChain.cs index a953534c..3d257e4d 100644 --- a/IxianDLT/Block/BlockChain.cs +++ b/IxianDLT/Block/BlockChain.cs @@ -1357,7 +1357,14 @@ public IxiNumber getMinSignerPowDifficulty(ulong blockNum) { return SignerPowSolution.bitsToDifficulty(0x00000000000000FF); } - var difficulty = getRequiredSignerDifficulty(blockNum, true) / ((ulong)tb.getFrozenSignatureCount() * 7); + // TODO Default to 7 after block 4200000 and remove everything related to 15 + uint minDiffRatio = 7; + if (blockNum < 4200000) + { + minDiffRatio = 15; + } + // + var difficulty = getRequiredSignerDifficulty(blockNum, true) / ((ulong)tb.getFrozenSignatureCount() * minDiffRatio); if (difficulty < ConsensusConfig.minBlockSignerPowDifficulty) { difficulty = ConsensusConfig.minBlockSignerPowDifficulty; diff --git a/IxianDLT/Meta/Config.cs b/IxianDLT/Meta/Config.cs index 10d94078..553198fe 100644 --- a/IxianDLT/Meta/Config.cs +++ b/IxianDLT/Meta/Config.cs @@ -101,7 +101,7 @@ public static string dataFolderBlocks public static ulong forceSyncToBlock = 0; // Read-only values - public static readonly string version = "xdc-0.9.2b"; // DLT Node version + public static readonly string version = "xdc-0.9.2c"; // DLT Node version public static readonly string checkVersionUrl = "https://www.ixian.io/update.txt"; public static readonly int checkVersionSeconds = 6 * 60 * 60; // 6 hours