Skip to content

Commit

Permalink
fixed sig verification exception when there are block gaps
Browse files Browse the repository at this point in the history
  • Loading branch information
IxiAngel committed Oct 8, 2024
1 parent 825fde5 commit 737d638
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions IxianDLT/Block/BlockProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,9 @@ public BlockVerifyStatus verifyBlockBasic(Block b, bool verify_sig = true, Remot
return BlockVerifyStatus.PotentiallyForkedBlock;
}

if (verify_sig)
ulong lastBlockNum = IxianHandler.getLastBlockHeight();

if (b.blockNum <= lastBlockNum + 1 && verify_sig)
{
bool skip_sig_verification = false;
if(pendingSuperBlocks.Count() > 0 && pendingSuperBlocks.OrderBy(x=> x.Key).Last().Key > b.blockNum)
Expand Down Expand Up @@ -888,8 +890,6 @@ public BlockVerifyStatus verifyBlockBasic(Block b, bool verify_sig = true, Remot
}
}

ulong lastBlockNum = IxianHandler.getLastBlockHeight();

if (prevBlock == null && lastBlockNum > 1) // block not found but blockChain is not empty, request the missing blocks
{
if (!Node.blockSync.synchronizing)
Expand Down

0 comments on commit 737d638

Please sign in to comment.