Skip to content

Commit

Permalink
xdc-0.9.2c fixed getMinSignerPowDifficulty() pre block 4200000 min di…
Browse files Browse the repository at this point in the history
…ff handling
  • Loading branch information
IxiAngel committed Jun 9, 2024
1 parent 1ca355d commit 20380da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion IxianDLT/Block/BlockChain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion IxianDLT/Meta/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 20380da

Please sign in to comment.