make terms acceptnace clearert

This commit is contained in:
Kukks
2024-03-07 12:08:16 +01:00
parent 9a8299d61e
commit 0efd3fc53a
3 changed files with 22 additions and 16 deletions

View File

@@ -13,7 +13,7 @@
<PropertyGroup>
<Product>Coinjoin</Product>
<Description>Allows you to integrate your btcpayserver store with coinjoins.</Description>
<Version>1.0.73</Version>
<Version>1.0.74</Version>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

View File

@@ -392,7 +392,14 @@ updateInProgressAnimation(myChart);
}
else if (coordinator.WasabiCoordinatorStatusFetcher.Connected)
{
if (coordinator.CoinJoinManager.TrackedWallets.TryGetValue(wallet.WalletName, out _))
var roundParameters = coordinator.RoundStateUpdater.RoundStates.LastOrDefault(pair => pair.Value.BlameOf == uint256.Zero).Value?.CoinjoinState.Parameters;
coordinator.CoinJoinManager.TrackedWallets.TryGetValue(wallet.WalletName, out var trackedWallet);
if(trackedWallet is {} && setting.RoundWhenEnabled is not null && roundParameters is not null && !BTCPayWallet.IsRoundOk(roundParameters, setting))
{
<a asp-controller="WabisabiStore" asp-action="UpdateWabisabiStoreSettings" asp-route-storeId="@storeId" class="h6 text-danger">
New terms detected
</a>
}else if (trackedWallet is {})
{
<span class="h6">Idle</span>
}

View File

@@ -116,22 +116,21 @@ namespace BTCPayServer.Plugins.Wabisabi
{
wabisabiStoreCoordinatorSettings.RoundWhenEnabled = null;
}
else if (
(termsCoord == wabisabiStoreCoordinatorSettings.Coordinator ||
res?.Settings?.Find(settings =>
settings.Coordinator == wabisabiStoreCoordinatorSettings.Coordinator)
?.RoundWhenEnabled is null) &&
_coordinatorClientInstanceManager.HostedServices.TryGetValue(
wabisabiStoreCoordinatorSettings.Coordinator, out var coordinator))
else if ((termsCoord == wabisabiStoreCoordinatorSettings.Coordinator || wabisabiStoreCoordinatorSettings.RoundWhenEnabled is null)&&
_coordinatorClientInstanceManager.HostedServices.TryGetValue(wabisabiStoreCoordinatorSettings.Coordinator, out var coordinator))
{
var round = coordinator.RoundStateUpdater.RoundStates.LastOrDefault();
wabisabiStoreCoordinatorSettings.RoundWhenEnabled = new LastCoordinatorRoundConfig()
wabisabiStoreCoordinatorSettings.RoundWhenEnabled =
round.Value?.CoinjoinState?.Parameters is { } roundParameters
? new LastCoordinatorRoundConfig()
{
CoordinationFeeRate = round.Value.CoinjoinState.Parameters.CoordinationFeeRate.Rate,
PlebsDontPayThreshold = round.Value.CoinjoinState.Parameters.CoordinationFeeRate
CoordinationFeeRate = roundParameters.CoordinationFeeRate.Rate,
PlebsDontPayThreshold = roundParameters.CoordinationFeeRate
.PlebsDontPayThreshold.Satoshi.ToString(),
MinInputCountByRound = round.Value.CoinjoinState.Parameters.MinInputCountByRound,
};
MinInputCountByRound = roundParameters.MinInputCountByRound,
}
: null;
}
}