Skip to content

Commit

Permalink
Minor change to make other PR easier to merge (WalletWasabi#13353)
Browse files Browse the repository at this point in the history
  • Loading branch information
lontivero authored Aug 30, 2024
1 parent 1a47be1 commit 8fd76db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion WalletWasabi.Daemon/Global.cs
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,10 @@ private void RegisterFeeRateProviders()

private void RegisterCoinJoinComponents()
{
var coordinatorUri = CoordinatorHttpClientFactory?.BackendUriGetter?.Invoke().AbsoluteUri;
var hasCoordinatorConfigured = !(coordinatorUri is null or "https://api.wasabiwallet.io/" or "https://api.wasabiwallet.co/");
var coinJoinConfiguration = new CoinJoinConfiguration(Config.CoordinatorIdentifier, Config.MaxCoinjoinMiningFeeRate, Config.AbsoluteMinInputCount, AllowSoloCoinjoining: false);
HostedServices.Register<CoinJoinManager>(() => new CoinJoinManager(WalletManager, CoordinatorHttpClientFactory, HostedServices.Get<WasabiSynchronizer>(), coinJoinConfiguration, CoinPrison), "CoinJoin Manager");
HostedServices.Register<CoinJoinManager>(() => new CoinJoinManager(WalletManager, CoordinatorHttpClientFactory, HostedServices.Get<WasabiSynchronizer>(), coinJoinConfiguration, CoinPrison, hasCoordinatorConfigured), "CoinJoin Manager");
}

private void WalletManager_WalletStateChanged(object? sender, WalletState e)
Expand Down
20 changes: 10 additions & 10 deletions WalletWasabi/WabiSabi/Client/CoinJoin/Manager/CoinJoinManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public CoinJoinManager(
WasabiHttpClientFactory? coordinatorHttpClientFactory,
IWasabiBackendStatusProvider wasabiBackendStatusProvider,
CoinJoinConfiguration coinJoinConfiguration,
CoinPrison coinPrison)
CoinPrison coinPrison,
bool hasCoordinatorConfigured = true)
{
WasabiBackendStatusProvide = wasabiBackendStatusProvider;
WalletProvider = walletProvider;
Expand All @@ -47,24 +48,23 @@ public CoinJoinManager(
RoundStatusUpdater = new RoundStateUpdater(TimeSpan.FromSeconds(10), handler);
CoinJoinConfiguration = coinJoinConfiguration;
CoinPrison = coinPrison;
HasCoordinatorConfigured = hasCoordinatorConfigured;
}

public event EventHandler<StatusChangedEventArgs>? StatusChanged;

private IWasabiBackendStatusProvider WasabiBackendStatusProvide { get; }

public ImmutableDictionary<WalletId, ImmutableList<SmartCoin>> CoinsInCriticalPhase { get; set; } = ImmutableDictionary<WalletId, ImmutableList<SmartCoin>>.Empty;
public IWalletProvider WalletProvider { get; }
public WasabiHttpClientFactory? HttpClientFactory { get; }
public RoundStateUpdater RoundStatusUpdater { get; }
public PersonCircuit RoundStateUpdaterCircuit { get; }
public CoinPrison CoinPrison { get; }
private IWalletProvider WalletProvider { get; }
private WasabiHttpClientFactory? HttpClientFactory { get; }
private RoundStateUpdater RoundStatusUpdater { get; }
private PersonCircuit RoundStateUpdaterCircuit { get; }
private CoinPrison CoinPrison { get; }

// A coordinator is configured if the backend URI is set to something other than the deprecated zkSNACKs' API endpoints.
public bool HasCoordinatorConfigured => HttpClientFactory is not null &&
!(HttpClientFactory.BackendUriGetter is null ||
HttpClientFactory.BackendUriGetter().AbsoluteUri == "https://api.wasabiwallet.io/" ||
HttpClientFactory.BackendUriGetter().AbsoluteUri == "https://api.wasabiwallet.co/");
public bool HasCoordinatorConfigured { get; }

private CoinRefrigerator CoinRefrigerator { get; } = new();
private CoinJoinConfiguration CoinJoinConfiguration { get; }

Expand Down

0 comments on commit 8fd76db

Please sign in to comment.