Skip to content
Permalink
Browse files

Ignore corrupted Transactions.json file

  • Loading branch information...
lontivero committed Nov 30, 2018
1 parent c3d0ff0 commit ad66db77bea263bb6e18bdb7d7ad27695be6675d
Showing with 19 additions and 11 deletions.
  1. +19 −11 WalletWasabi/Services/WalletService.cs
@@ -212,22 +212,30 @@ public async Task InitializeAsync(CancellationToken cancel)
// Load in dummy mempool
if (File.Exists(TransactionsFilePath))
{
string jsonString = File.ReadAllText(TransactionsFilePath, Encoding.UTF8);
var serializedTransactions = JsonConvert.DeserializeObject<IEnumerable<SmartTransaction>>(jsonString);

foreach (SmartTransaction tx in serializedTransactions.Where(x => !x.Confirmed))
try
{
try
{
await SendTransactionAsync(tx);
string jsonString = File.ReadAllText(TransactionsFilePath, Encoding.UTF8);
var serializedTransactions = JsonConvert.DeserializeObject<IEnumerable<SmartTransaction>>(jsonString);

ProcessTransaction(tx);
}
catch (Exception ex)
foreach (SmartTransaction tx in serializedTransactions.Where(x => !x.Confirmed))
{
Logger.LogWarning<WalletService>(ex);
try
{
await SendTransactionAsync(tx);

ProcessTransaction(tx);
}
catch (Exception ex)
{
Logger.LogWarning<WalletService>(ex);
}
}
}
catch(Exception ex)
{
Logger.LogWarning<WalletService>(ex);
}

try
{
File.Delete(TransactionsFilePath);

0 comments on commit ad66db7

Please sign in to comment.
You can’t perform that action at this time.