mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2026-01-31 21:45:02 +01:00
fix round checker serialization issue
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
<PropertyGroup>
|
||||
<Product>Wabisabi Coinjoin</Product>
|
||||
<Description>Allows you to integrate your btcpayserver store with coinjoins.</Description>
|
||||
<Version>1.0.17</Version>
|
||||
<Version>1.0.18</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Plugin development properties -->
|
||||
|
||||
@@ -175,7 +175,7 @@ public class BTCPayWallet : IWallet, IDestinationProvider
|
||||
return coordSettings.RoundWhenEnabled is not null &&
|
||||
roundParameters.CoordinationFeeRate.Rate <= coordSettings.RoundWhenEnabled.CoordinationFeeRate &&
|
||||
roundParameters.CoordinationFeeRate.PlebsDontPayThreshold <=
|
||||
coordSettings.RoundWhenEnabled.PlebsDontPayThreshold &&
|
||||
coordSettings.RoundWhenEnabled.PlebsDontPayThresholdM &&
|
||||
roundParameters.MinInputCountByRound <= coordSettings.RoundWhenEnabled.MinInputCountByRound;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
@@ -5,6 +5,7 @@ using BTCPayServer.Abstractions.Contracts;
|
||||
using BTCPayServer.Data;
|
||||
using BTCPayServer.PayoutProcessors;
|
||||
using BTCPayServer.Services;
|
||||
using NBitcoin;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace BTCPayServer.Plugins.Wabisabi
|
||||
@@ -38,6 +39,13 @@ namespace BTCPayServer.Plugins.Wabisabi
|
||||
var res = await _storeRepository.GetSettingAsync<WabisabiStoreSettings>(storeId, nameof(WabisabiStoreSettings));
|
||||
res ??= new WabisabiStoreSettings();
|
||||
res.Settings = res.Settings.Where(settings => _ids.Contains(settings.Coordinator)).ToList();
|
||||
res.Settings.ForEach(settings =>
|
||||
{
|
||||
if(settings.RoundWhenEnabled != null && string.IsNullOrEmpty(settings.RoundWhenEnabled.PlebsDontPayThreshold))
|
||||
{
|
||||
settings.RoundWhenEnabled.PlebsDontPayThreshold = "1000000";
|
||||
}
|
||||
});
|
||||
foreach (var wabisabiCoordinatorManager in _coordinatorClientInstanceManager.HostedServices)
|
||||
{
|
||||
if (res.Settings.All(settings => settings.Coordinator != wabisabiCoordinatorManager.Key))
|
||||
@@ -85,7 +93,7 @@ namespace BTCPayServer.Plugins.Wabisabi
|
||||
{
|
||||
CoordinationFeeRate = round.Value.CoinjoinState.Parameters.CoordinationFeeRate.Rate,
|
||||
PlebsDontPayThreshold = round.Value.CoinjoinState.Parameters.CoordinationFeeRate
|
||||
.PlebsDontPayThreshold,
|
||||
.PlebsDontPayThreshold.Satoshi.ToString(),
|
||||
MinInputCountByRound = round.Value.CoinjoinState.Parameters.MinInputCountByRound,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -46,7 +46,9 @@ public class LastCoordinatorRoundConfig
|
||||
{
|
||||
|
||||
public decimal CoordinationFeeRate { get; set; }
|
||||
[JsonConverter(typeof(MoneyJsonConverter))]
|
||||
public Money PlebsDontPayThreshold { get; set; }
|
||||
public string PlebsDontPayThreshold { get; set; }
|
||||
[JsonIgnore]
|
||||
public Money PlebsDontPayThresholdM => Money.Parse(PlebsDontPayThreshold);
|
||||
|
||||
public int MinInputCountByRound { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user