Skip to content

Commit aa709fb

Browse files
committed
minor improvements
1 parent 9fc2b12 commit aa709fb

File tree

4 files changed

+12
-30
lines changed

4 files changed

+12
-30
lines changed

IxianDLT/DLTNode.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.2" />
3030
<PackageReference Include="FluentCommandLineParser" Version="1.4.3" />
3131
<PackageReference Include="Open.Nat" Version="2.1.0" />
32-
<PackageReference Include="RocksDB" Version="10.2.1.58549" />
32+
<PackageReference Include="RocksDB" Version="10.4.2.62659" />
3333
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
3434
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
3535
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="9.0.9" />

IxianDLT/Meta/Config.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ private static string outputHelp()
175175
Console.WriteLine(" [--worker] [--threads 1] [--config ixian.cfg] [--maxLogSize 50] [--maxLogCount 10] [--logVerbosity 14]");
176176
Console.WriteLine(" [--lastGoodBlock 110234] [--disableWebStart] [--onlyShowAddresses] [--walletPassword] [--blockStorage SQLite]");
177177
Console.WriteLine(" [--maxTxPerBlock 19980] [--disableSetTitle] [--disableFastBlockLoading] [--checksumLock Ixian] [--verboseOutput]");
178-
Console.WriteLine(" [--maxOutgoingConnections] [--maxIncomingMasterNodes] [--maxIncomingClientNodes] [--minActivityBlockHeight]");
178+
Console.WriteLine(" [--maxOutgoingConnections] [--maxIncomingMasterNodes] [--maxIncomingClientNodes]");
179179
Console.WriteLine(" [--forceSyncToBlock]");
180180
Console.WriteLine(" [--genesis] [--netdump dumpfile] [--benchmark type] [--recover] [--verifyStorage] [--generateWallet]");
181181
Console.WriteLine(" [--optimizeDBStorage] [--offline] [--disableChainReorg] [--chainReorgTest]");
@@ -209,7 +209,6 @@ private static string outputHelp()
209209
Console.WriteLine(" --maxOutgoingConnections\t Max outgoing connections.");
210210
Console.WriteLine(" --maxIncomingMasterNodes\t Max incoming masternode connections.");
211211
Console.WriteLine(" --maxIncomingClientNodes\t Max incoming client connections.");
212-
Console.WriteLine(" --minActivityBlockHeight\t Prune activity older than specified block height (30000 is default, 0 disables it).");
213212
Console.WriteLine(" --forceSyncToBlock\t\t Force sync to specified block height.");
214213
Console.WriteLine(" --networkType\t\t mainnet, testnet or regtest.");
215214
Console.WriteLine(" --dataFolderPath\t\t location where to store block and transaction data.");
@@ -258,8 +257,8 @@ private static string outputHelp()
258257
Console.WriteLine(" blockNotify\t\t\t Execute command when the block changes");
259258
Console.WriteLine(" dataFolderPath\t\t location where to store block and transaction data.");
260259
Console.WriteLine(" logFolderPath\t\t location where to store log files.");
261-
Console.WriteLine(" activityFolderPath\t\t location where to store activity files.");
262-
Console.WriteLine(" maxDatabaseCache\t\t max RAM in bytes to use for RocksDB Cache.");
260+
Console.WriteLine(" activityFolderPath\t location where to store activity files.");
261+
Console.WriteLine(" maxDatabaseCache\t max RAM in bytes to use for RocksDB Cache.");
263262

264263
return "";
265264
}
@@ -605,8 +604,6 @@ private static void processCliParmeters(string[] args)
605604

606605
cmd_parser.Setup<int>("maxIncomingClientNodes").Callback(value => maxIncomingClientNodes = value);
607606

608-
cmd_parser.Setup<int>("minActivityBlockHeight").Callback(value => CoreConfig.minActivityBlockHeight = value);
609-
610607
cmd_parser.Setup<long>("forceSyncToBlock").Callback(value => forceSyncToBlock = (ulong)value);
611608

612609
cmd_parser.Setup<long>("maxDatabaseCache").Callback(value => maxDatabaseCache = (ulong)value);

IxianDLT/Network/BlockProtocolMessages.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ public static void handleGetRelevantBlockTransactions(byte[] data, RemoteEndpoin
199199
}
200200
}
201201

202-
203202
public static void handleGetPIT2(byte[] data, RemoteEndpoint endpoint)
204203
{
205204
MemoryStream ms = new MemoryStream(data);

IxianDLT/Transaction/TransactionPool.cs

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2770,15 +2770,13 @@ public static void performCleanup()
27702770

27712771
public static void processPendingTransactions()
27722772
{
2773-
// TODO TODO this has to be refactored and moved to PendingTransactions
27742773
ulong last_block_height = IxianHandler.getLastBlockHeight();
27752774
lock (stateLock) // this lock must be here to prevent deadlocks TODO: improve this at some point
27762775
{
27772776
lock (PendingTransactions.pendingTransactions)
27782777
{
27792778
long cur_time = Clock.getTimestamp();
2780-
List<PendingTransaction> tmp_pending_transactions = new List<PendingTransaction>(PendingTransactions.pendingTransactions);
2781-
int idx = 0;
2779+
List<PendingTransaction> tmp_pending_transactions = new(PendingTransactions.pendingTransactions);
27822780
foreach (var entry in tmp_pending_transactions)
27832781
{
27842782
Transaction t = entry.transaction;
@@ -2791,8 +2789,10 @@ public static void processPendingTransactions()
27912789
}
27922790

27932791
// if transaction expired, remove it from pending transactions
2794-
if (last_block_height > ConsensusConfig.getRedactedWindowSize() && t.blockHeight < last_block_height - ConsensusConfig.getRedactedWindowSize())
2792+
if (last_block_height > ConsensusConfig.getRedactedWindowSize()
2793+
&& t.blockHeight < last_block_height - ConsensusConfig.getRedactedWindowSize())
27952794
{
2795+
Logging.error("Error sending the transaction {0}, expired", t.getTxIdString());
27962796
Node.activityStorage.updateStatus(t.id, ActivityStatus.Error, 0);
27972797
PendingTransactions.pendingTransactions.RemoveAll(x => x.transaction.id.SequenceEqual(t.id));
27982798
continue;
@@ -2822,29 +2822,15 @@ public static void processPendingTransactions()
28222822
}
28232823
}
28242824

2825-
if ((int)entry.confirmedNodeList.Count() > 3) // already received 3+ feedback
2826-
{
2827-
continue;
2828-
}
2829-
2830-
if (cur_time - tx_time > 40) // if the transaction is pending for over 40 seconds, resend
2825+
if (cur_time - tx_time > 60) // if the transaction is pending for over 60 seconds, resend
28312826
{
2827+
Logging.warn("Transaction {0} pending for a while, resending", t.getTxIdString());
28322828
CoreProtocolMessage.broadcastProtocolMessage(new char[] { 'M', 'H' }, ProtocolMessageCode.transactionData2, t.getBytes(true, true), null);
2829+
28332830
entry.addedTimestamp = cur_time;
28342831
entry.confirmedNodeList.Clear();
2832+
entry.rejectedNodeList.Clear();
28352833
}
2836-
2837-
if (entry.confirmedNodeList.Count() > 3) // already received 3+ feedback
2838-
{
2839-
continue;
2840-
}
2841-
2842-
if (cur_time - tx_time > 20) // if the transaction is pending for over 20 seconds, send inquiry
2843-
{
2844-
CoreProtocolMessage.broadcastGetTransaction(t.id, 0, null, false);
2845-
}
2846-
2847-
idx++;
28482834
}
28492835
}
28502836
}

0 commit comments

Comments
 (0)