Skip to content

Commit

Permalink
xdc-0.6.6g
Browse files Browse the repository at this point in the history
- optimized TransactionPool.performCleanup()
- optimized TransactionPool.processPendingTransactions()
- moved call to TransactionPool.performCleanup() to BlockProcessor.applyAcceptedBlock()
- improved sync
  • Loading branch information
IxiAngel committed Jan 6, 2020
1 parent d6a4336 commit d647ab1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
6 changes: 6 additions & 0 deletions IxianDLT/Block/BlockProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1752,6 +1752,12 @@ public bool applyAcceptedBlock(Block b, bool ws_snapshot = false)
// Update wallet state public keys
updateWalletStatePublicKeys(b.blockNum, ws_snapshot);

if(ws_snapshot == false)
{
// Cleanup transaction pool
TransactionPool.performCleanup();
}

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion IxianDLT/Block/BlockSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ private void rollForward()
return;
}

if (!Node.blockProcessor.verifyBlockSignatures(b) && Node.blockChain.Count > 16)
if (!b.fromLocalStorage && !Node.blockProcessor.verifyBlockSignatures(b) && Node.blockChain.Count > 16)
{
Logging.warn(String.Format("Block #{0} {1} doesn't have the required consensus. Discarding and requesting a new one.", b.blockNum, Crypto.hashToString(b.blockChecksum)));
pendingBlocks.RemoveAll(x => x.blockNum == b.blockNum);
Expand Down
2 changes: 1 addition & 1 deletion IxianDLT/Meta/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static string dataFolderBlocks
public static string externalIp = "";

// Read-only values
public static readonly string version = "xdc-0.6.6f"; // DLT Node version
public static readonly string version = "xdc-0.6.6g"; // DLT Node version
public static readonly int checkVersionSeconds = 6 * 60 * 60; // 6 hours

public static readonly ulong maxBlocksPerDatabase = 1000; // number of blocks to store in a single database file
Expand Down
3 changes: 0 additions & 3 deletions IxianDLT/Meta/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -747,9 +747,6 @@ private static void performMaintenance()

TransactionPool.processPendingTransactions();

// Cleanup transaction pool
TransactionPool.performCleanup();

// Cleanup the presence list
PresenceList.performCleanup();
}
Expand Down
4 changes: 2 additions & 2 deletions IxianDLT/Transaction/TransactionPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,7 @@ public static void performCleanup()
}
}

Block block = Node.blockChain.getBlock(blocknum);
Block block = Node.blockChain.getBlock(blocknum, false, false);

if (block == null || block.powField != null)
{
Expand Down Expand Up @@ -2356,7 +2356,7 @@ public static void processPendingTransactions()
{
ulong pow_block_num = BitConverter.ToUInt64(t.data, 0);

Block tmpBlock = Node.blockChain.getBlock(pow_block_num);
Block tmpBlock = Node.blockChain.getBlock(pow_block_num, false, false);
if (tmpBlock == null || tmpBlock.powField != null)
{
ActivityStorage.updateStatus(Encoding.UTF8.GetBytes(t.id), ActivityStatus.Error, 0);
Expand Down

0 comments on commit d647ab1

Please sign in to comment.