Recover broken index file
Index file can be corrupted after an unexpected exit. When that
happened, the wallet client couldn't open anymore.
MODIFY
WalletWasabi/Services/IndexDownloader.cs
WalletWasabi/Services/IndexDownloader.cs
@@ -159,6 +159,8 @@ namespace WalletWasabi.Services
else
{
var height = StartingHeight;
+ try
+ {
foreach (var line in File.ReadAllLines(IndexFilePath))
{
var filter = FilterModel.FromLine(line, height);
@@ -166,6 +168,13 @@ namespace WalletWasabi.Services
Index.Add(filter);
}
}
+ catch(FormatException)
+ {
+ // We found a corrupted entry. Stop here.
+ // Fix the currupted file.
+ File.WriteAllLines(IndexFilePath, Index.Select(x => x.ToLine()));
+ }
+ }
}
else
{

Recover broken index file

Index file can be corrupted after an unexpected exit. When that
happened, the wallet client couldn't open anymore.