Skip to content

Commit

Permalink
xdc-0.9.3c
Browse files Browse the repository at this point in the history
SignerPowMiner fixes
  • Loading branch information
IxiAngel committed Dec 9, 2024
1 parent c795a14 commit b5df20e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
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.3b"; // DLT Node version
public static readonly string version = "xdc-0.9.3c"; // 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
8 changes: 5 additions & 3 deletions IxianDLT/Miner/SignerPowMiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,15 @@ private void searchForBlock()
return;
}

uint blockOffset = 7;

if (candidateBlock.blockNum <= 14)
{
candidateBlock = Node.blockChain.getBlock(1, false, false);
}
else
{
candidateBlock = Node.blockChain.getBlock(candidateBlock.blockNum - 7, false, false);
candidateBlock = Node.blockChain.getBlock(candidateBlock.blockNum - blockOffset, false, false);
}

if (candidateBlock == null)
Expand Down Expand Up @@ -231,7 +233,7 @@ private void searchForBlock()
ulong calculationInterval = ConsensusConfig.getPlPowCalculationInterval(IxianHandler.getLastBlockVersion());

ulong highestNetworkBlockHeight = IxianHandler.getHighestKnownNetworkBlockHeight();
if (candidateBlock.blockNum + calculationInterval < highestNetworkBlockHeight)
if (candidateBlock.blockNum + calculationInterval + blockOffset < highestNetworkBlockHeight)
{
// Catching up to the network
return;
Expand All @@ -240,7 +242,7 @@ private void searchForBlock()
var submittedSolution = PresenceList.getPowSolution();
if (lastSignerPowSolution != null
&& Node.blockChain.getTimeSinceLastBlock() < 450
&& lastSignerPowSolution.blockNum + calculationInterval > highestNetworkBlockHeight
&& lastSignerPowSolution.blockNum + calculationInterval + blockOffset > highestNetworkBlockHeight
&& (submittedSolution != null && solvingDifficulty <= submittedSolution.difficulty))
{
// If the chain isn't stuck and we've already processed PoW within the interval
Expand Down

0 comments on commit b5df20e

Please sign in to comment.