Improve Tor url generation.
MODIFY
WalletWasabi.Backend/InitConfigStartupTask.cs
WalletWasabi.Backend/InitConfigStartupTask.cs
@@ -52,7 +52,7 @@ namespace WalletWasabi.Backend
try
{
- WebsiteTorifier.CloneAndUpdateOnionIndexHtml();
+ await WebsiteTorifier.CloneAndUpdateOnionIndexHtmlAsync();
}
catch (Exception ex)
{

MODIFY
WalletWasabi.Backend/WebsiteTorifier.cs
WalletWasabi.Backend/WebsiteTorifier.cs
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Threading.Tasks;
namespace WalletWasabi.Backend
{
@@ -17,21 +18,17 @@ namespace WalletWasabi.Backend
UnversionedFolder = Path.GetFullPath(Path.Combine(RootFolder, "unversioned"));
}
- public void CloneAndUpdateOnionIndexHtml()
+ public async Task CloneAndUpdateOnionIndexHtmlAsync()
{
var path = Path.Combine(RootFolder, "index.html");
var onionPath = Path.Combine(RootFolder, "onion-index.html");
- var content = File.ReadAllText(path);
+ var content = await File.ReadAllTextAsync(path);
content = content.Replace("http://wasabiukrxmkdgve5kynjztuovbg43uxcbcxn6y2okcrsg7gb6jdmbad.onion", "https://wasabiwallet.io", StringComparison.Ordinal);
- content = content.Replace("https://blockstream.info/tx/e4a789d16a24a6643dfee06e018ad27648b896daae6a3577ae0f4eddcc4d9174", "http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/tx/e4a789d16a24a6643dfee06e018ad27648b896daae6a3577ae0f4eddcc4d9174", StringComparison.Ordinal);
- content = content.Replace("https://blockstream.info/tx/c69aed505ca50473e2883130221915689c1474be3c66bcf7ac7dc0e26246afc8", "http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/tx/c69aed505ca50473e2883130221915689c1474be3c66bcf7ac7dc0e26246afc8", StringComparison.Ordinal);
- content = content.Replace("https://blockstream.info/tx/ef329b3ed8e790f10f0b522346f1b3d9f1c9d45dfa5b918e92d6f0a25d91c7ce", "http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/tx/ef329b3ed8e790f10f0b522346f1b3d9f1c9d45dfa5b918e92d6f0a25d91c7ce", StringComparison.Ordinal);
- content = content.Replace("https://blockstream.info/tx/f82206145413db5c1272d5609c88581c414815e36e400aee6410e0de9a2d46b5", "http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/tx/f82206145413db5c1272d5609c88581c414815e36e400aee6410e0de9a2d46b5", StringComparison.Ordinal);
- content = content.Replace("https://blockstream.info/tx/a7157780b7c696ab24767113d9d34cdbc0eba5c394c89aec4ed1a9feb326bea5", "http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/tx/a7157780b7c696ab24767113d9d34cdbc0eba5c394c89aec4ed1a9feb326bea5", StringComparison.Ordinal);
+ content = content.Replace("https://blockstream.info", "http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion", StringComparison.Ordinal);
- File.WriteAllText(onionPath, content);
+ await File.WriteAllTextAsync(onionPath, content);
}
}
}

Improve Tor url generation.