Connect to peers through tor network only
MODIFY
WalletWasabi.Gui/Global.cs
WalletWasabi.Gui/Global.cs
@@ -242,6 +242,8 @@ namespace WalletWasabi.Gui
connectionParameters.TemplateBehaviors.Add(addressManagerBehavior);
MemPoolService = new MemPoolService();
connectionParameters.TemplateBehaviors.Add(new MemPoolBehavior(MemPoolService));
+ connectionParameters.EndpointConnector = new TorOnlyEndpointConnector();
+ connectionParameters.TemplateBehaviors.Add(new SocksSettingsBehavior(Config.GetTorSocks5EndPoint()));
if (Network == Network.RegTest)
{

ADD
WalletWasabi.Gui/TorOnlyEndpointConnector.cs
+#if !NOSOCKET
+using NBitcoin;
+using NBitcoin.Protocol;
+using NBitcoin.Protocol.Behaviors;
+using NBitcoin.Protocol.Connectors;
+using NBitcoin.Socks;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace WalletWasabi.Gui
+{
+ public class TorOnlyEndpointConnector : IEnpointConnector
+ {
+ private DefaultEndpointConnector _defaultEndpointConnector = new DefaultEndpointConnector();
+
+ public TorOnlyEndpointConnector()
+ {
+ }
+
+ public async Task ConnectSocket(Socket socket, EndPoint endpoint, NodeConnectionParameters nodeConnectionParameters, CancellationToken cancellationToken)
+ {
+ if(!endpoint.IsTor())
+ return;
+ await _defaultEndpointConnector.ConnectSocket(socket, endpoint, nodeConnectionParameters, cancellationToken);
+ }
+ }
+}
+#endif
\ No newline at end of file

MODIFY
WalletWasabi/WalletWasabi.csproj
WalletWasabi/WalletWasabi.csproj
<ItemGroup>
<PackageReference Include="NBitcoin" Version="4.1.1.96" />
</ItemGroup>
-
<ItemGroup>
<Folder Include="Gma\QrCodeNet\Encoding\ReedSolomon\" />
</ItemGroup>

Connect to peers through tor network only