Use HttpClientFactory instead of Synchronizer (TransactionBroadcaster.cs)
MODIFY
WalletWasabi.Gui/Global.cs
WalletWasabi.Gui/Global.cs
@@ -103,7 +103,7 @@ namespace WalletWasabi.Gui
Synchronizer = new WasabiSynchronizer(Network, BitcoinStore, HttpClientFactory);
LegalChecker = new(DataDir);
- TransactionBroadcaster = new TransactionBroadcaster(Network, BitcoinStore, Synchronizer, WalletManager);
+ TransactionBroadcaster = new TransactionBroadcaster(Network, BitcoinStore, HttpClientFactory, WalletManager);
}
}

MODIFY
WalletWasabi.Tests/RegressionTests/BuildTests.cs
WalletWasabi.Tests/RegressionTests/BuildTests.cs
@@ -254,7 +254,7 @@ namespace WalletWasabi.Tests.RegressionTests
using var wallet = await walletManager.AddAndStartWalletAsync(keyManager);
var coin = Assert.Single(wallet.Coins);
Assert.True(coin.Confirmed);
- var broadcaster = new TransactionBroadcaster(network, bitcoinStore, synchronizer, walletManager);
+ var broadcaster = new TransactionBroadcaster(network, bitcoinStore, httpClientFactory, walletManager);
broadcaster.Initialize(nodes, rpc);
// Send money before reorg.

MODIFY
WalletWasabi.Tests/RegressionTests/SendTests.cs
WalletWasabi.Tests/RegressionTests/SendTests.cs
@@ -87,7 +87,7 @@ namespace WalletWasabi.Tests.RegressionTests
await Common.WaitForFiltersToBeProcessedAsync(TimeSpan.FromSeconds(120), blockCount);
var wallet = await walletManager.AddAndStartWalletAsync(keyManager);
- var broadcaster = new TransactionBroadcaster(network, bitcoinStore, synchronizer, walletManager);
+ var broadcaster = new TransactionBroadcaster(network, bitcoinStore, httpClientFactory, walletManager);
broadcaster.Initialize(nodes, rpc);
var waitCount = 0;
@@ -575,7 +575,7 @@ namespace WalletWasabi.Tests.RegressionTests
Assert.Equal(tx0Id, eventArgs.NewlyReceivedCoins.Single().TransactionId);
Assert.Single(wallet.Coins);
- var broadcaster = new TransactionBroadcaster(network, bitcoinStore, synchronizer, walletManager);
+ var broadcaster = new TransactionBroadcaster(network, bitcoinStore, httpClientFactory, walletManager);
broadcaster.Initialize(nodes, rpc);
var operations = new PaymentIntent(

MODIFY
WalletWasabi/Blockchain/TransactionBroadcasting/TransactionBroadcaster.cs
WalletWasabi/Blockchain/TransactionBroadcasting/TransactionBroadcaster.cs
@@ -19,16 +19,16 @@ namespace WalletWasabi.Blockchain.TransactionBroadcasting
{
public class TransactionBroadcaster
{
- public TransactionBroadcaster(Network network, BitcoinStore bitcoinStore, WasabiSynchronizer synchronizer, WalletManager walletManager)
+ public TransactionBroadcaster(Network network, BitcoinStore bitcoinStore, HttpClientFactory httpClientFactory, WalletManager walletManager)
{
Network = Guard.NotNull(nameof(network), network);
BitcoinStore = Guard.NotNull(nameof(bitcoinStore), bitcoinStore);
- Synchronizer = Guard.NotNull(nameof(synchronizer), synchronizer);
+ HttpClientFactory = Guard.NotNull(nameof(httpClientFactory), httpClientFactory);
WalletManager = Guard.NotNull(nameof(walletManager), walletManager);
}
public BitcoinStore BitcoinStore { get; }
- public WasabiSynchronizer Synchronizer { get; }
+ public HttpClientFactory HttpClientFactory { get; }
public Network Network { get; }
public NodesGroup? Nodes { get; private set; }
public IRPCClient? RpcClient { get; private set; }
@@ -90,7 +90,7 @@ namespace WalletWasabi.Blockchain.TransactionBroadcasting
private async Task BroadcastTransactionToBackendAsync(SmartTransaction transaction)
{
Logger.LogInfo("Broadcasting with backend...");
- IHttpClient httpClient = Synchronizer.HttpClientFactory.NewBackendHttpClient(isolateStream: true);
+ IHttpClient httpClient = HttpClientFactory.NewBackendHttpClient(isolateStream: true);
try
{

Use HttpClientFactory instead of Synchronizer (TransactionBroadcaster.cs)