Turn on the optimization with 20_000 headers at most.
MODIFY
WalletWasabi.Fluent/Global.cs
WalletWasabi.Fluent/Global.cs
@@ -83,7 +83,9 @@ public class Global
var networkWorkFolderPath = Path.Combine(DataDir, "BitcoinStore", Network.ToString());
var transactionStore = new AllTransactionStore(networkWorkFolderPath, Network);
- var indexStore = new IndexStore(Path.Combine(networkWorkFolderPath, "IndexStore"), Network, new SmartHeaderChain());
+
+ SmartHeaderChain smartHeaderChain = new(maxChainSize: 20_000);
+ var indexStore = new IndexStore(Path.Combine(networkWorkFolderPath, "IndexStore"), Network, smartHeaderChain);
var mempoolService = new MempoolService();
var blocks = new FileSystemBlockRepository(Path.Combine(networkWorkFolderPath, "Blocks"), Network);

MODIFY
WalletWasabi/Stores/IndexStore.cs
WalletWasabi/Stores/IndexStore.cs
@@ -140,13 +140,15 @@ public class IndexStore : IAsyncDisposable
{
if (MatureIndexFileManager.Exists())
{
- using (BenchmarkLogger.Measure(LogLevel.Info, "XXX MatureIndexFileManager loading"))
+ using (BenchmarkLogger.Measure(LogLevel.Debug, "MatureIndexFileManager loading"))
{
+ int i = 0;
using StreamReader sr = MatureIndexFileManager.OpenText();
if (!sr.EndOfStream)
{
while (true)
{
+ i++;
cancel.ThrowIfCancellationRequested();
string? line = await sr.ReadLineAsync().ConfigureAwait(false);
@@ -158,6 +160,8 @@ public class IndexStore : IAsyncDisposable
ProcessLine(line, enqueue: false);
}
}
+
+ Logger.LogDebug($"Loaded {i} lines from the mature index file.");
}
}
}

Turn on the optimization with 20_000 headers at most.