mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2025-12-18 08:04:26 +01:00
upd ww
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=0D438B7D_002DF996_002D4BF3_002D8F54_002D02CB9DF120D8_002Ff_003ABTCPayCoinjoinCoinSelector_002Ecs/@EntryIndexedValue">ExplicitlyExcluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=0D438B7D_002DF996_002D4BF3_002D8F54_002D02CB9DF120D8_002Ff_003ABTCPayCoinjoinCoinSelector_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=0D438B7D_002DF996_002D4BF3_002D8F54_002D02CB9DF120D8_002Ff_003ABTCPayWallet_002Ecs/@EntryIndexedValue">ExplicitlyExcluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=0D438B7D_002DF996_002D4BF3_002D8F54_002D02CB9DF120D8_002Ff_003ABTCPayWallet_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=D1D1116C_002D38F9_002D4EA3_002DAC65_002DA75FEA82E5C8_002Fd_003ABlockchain_002Fd_003ATransactionOutputs_002Ff_003ACoinsView_002Ecs/@EntryIndexedValue">ExplicitlyExcluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=D1D1116C_002D38F9_002D4EA3_002DAC65_002DA75FEA82E5C8_002Fd_003ABlockchain_002Fd_003ATransactionOutputs_002Ff_003ACoinsView_002Ecs/@EntryIndexedValue">ExplicitlyExcluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=D1D1116C_002D38F9_002D4EA3_002DAC65_002DA75FEA82E5C8_002Fd_003ABlockchain_002Fd_003ATransactionOutputs_002Ff_003ASmartCoin_002Ecs/@EntryIndexedValue">ExplicitlyExcluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=D1D1116C_002D38F9_002D4EA3_002DAC65_002DA75FEA82E5C8_002Fd_003ABlockchain_002Fd_003ATransactionOutputs_002Ff_003ASmartCoin_002Ecs/@EntryIndexedValue">ExplicitlyExcluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=D1D1116C_002D38F9_002D4EA3_002DAC65_002DA75FEA82E5C8_002Fd_003AWabiSabi_002Fd_003AClient_002Ff_003ACoinJoinClient_002Ecs/@EntryIndexedValue">ExplicitlyExcluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=D1D1116C_002D38F9_002D4EA3_002DAC65_002DA75FEA82E5C8_002Fd_003AWabiSabi_002Fd_003AClient_002Ff_003ACoinJoinClient_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=D1D1116C_002D38F9_002D4EA3_002DAC65_002DA75FEA82E5C8_002Fd_003AWabiSabi_002Fd_003AClient_002Ff_003ACoinJoinManager_002Ecs/@EntryIndexedValue">ExplicitlyExcluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=D1D1116C_002D38F9_002D4EA3_002DAC65_002DA75FEA82E5C8_002Fd_003AWabiSabi_002Fd_003AClient_002Ff_003ACoinJoinManager_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=D1D1116C_002D38F9_002D4EA3_002DAC65_002DA75FEA82E5C8_002Fd_003AWabiSabi_002Fd_003AClient_002Ff_003ACoinJoinTracker_002Ecs/@EntryIndexedValue">ExplicitlyExcluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=D1D1116C_002D38F9_002D4EA3_002DAC65_002DA75FEA82E5C8_002Fd_003AWabiSabi_002Fd_003AClient_002Ff_003ACoinJoinTracker_002Ecs/@EntryIndexedValue">ExplicitlyExcluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=D1D1116C_002D38F9_002D4EA3_002DAC65_002DA75FEA82E5C8_002Fd_003AWabiSabi_002Fd_003AClient_002Ff_003ACoinJoinTrackerFactory_002Ecs/@EntryIndexedValue">ExplicitlyExcluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=D1D1116C_002D38F9_002D4EA3_002DAC65_002DA75FEA82E5C8_002Fd_003AWabiSabi_002Fd_003AClient_002Ff_003ACoinJoinTrackerFactory_002Ecs/@EntryIndexedValue">ExplicitlyExcluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=D1D1116C_002D38F9_002D4EA3_002DAC65_002DA75FEA82E5C8_002Fd_003AWallets_002Ff_003AWallet_002Ecs/@EntryIndexedValue">ExplicitlyExcluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=D1D1116C_002D38F9_002D4EA3_002DAC65_002DA75FEA82E5C8_002Fd_003AWallets_002Ff_003AWallet_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=cedf4985_002D652b_002D4803_002D9af5_002D7e2c856d885a/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="EnsureNewLightningInvoiceOnPartialPayment" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=cedf4985_002D652b_002D4803_002D9af5_002D7e2c856d885a/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="EnsureNewLightningInvoiceOnPartialPayment" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||||
<TestAncestor>
|
<TestAncestor>
|
||||||
<TestId>xUnit::4146B6DF-7BEE-4BD0-B6B1-77E7630A1B81::net8.0::BTCPayServer.Tests.UnitTest1.EnsureNewLightningInvoiceOnPartialPayment</TestId>
|
<TestId>xUnit::4146B6DF-7BEE-4BD0-B6B1-77E7630A1B81::net8.0::BTCPayServer.Tests.UnitTest1.EnsureNewLightningInvoiceOnPartialPayment</TestId>
|
||||||
|
|||||||
@@ -134,11 +134,11 @@ public class BTCPayCoinjoinCoinSelector : IRoundCoinSelector
|
|||||||
Dictionary<AnonsetType, int> idealMinimumPerType = new Dictionary<AnonsetType, int>()
|
Dictionary<AnonsetType, int> idealMinimumPerType = new Dictionary<AnonsetType, int>()
|
||||||
{{AnonsetType.Red, 1}, {AnonsetType.Orange, 1}, {AnonsetType.Green, 1}};
|
{{AnonsetType.Red, 1}, {AnonsetType.Orange, 1}, {AnonsetType.Green, 1}};
|
||||||
|
|
||||||
var solution = await SelectCoinsInternal(utxoSelectionParameters, candidates, ineligibleCoins,payments,
|
var solution = await SelectCoinsInternal(utxoSelectionParameters, candidates,payments,
|
||||||
Random.Shared.Next(20, 31),
|
Random.Shared.Next(20, 31),
|
||||||
maxPerType,
|
maxPerType,
|
||||||
idealMinimumPerType,
|
idealMinimumPerType,
|
||||||
consolidationMode, liquidityClue, secureRandom,mixReasons);
|
consolidationMode, liquidityClue, secureRandom);
|
||||||
|
|
||||||
if (attemptingTobeParanoidWhenDoingPayments && !solution.HandledPayments.Any())
|
if (attemptingTobeParanoidWhenDoingPayments && !solution.HandledPayments.Any())
|
||||||
{
|
{
|
||||||
@@ -192,7 +192,7 @@ public class BTCPayCoinjoinCoinSelector : IRoundCoinSelector
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mixReasons.Contains(IWallet.MixingReason.NotPrivate) && coins.All(coin => coin.SmartCoin.IsPrivate(_wallet.AnonScoreTarget)))
|
if (mixReasons.Contains(IWallet.MixingReason.NotPrivate) && coins.All(coin => coin.SmartCoin.IsPrivate(_wallet)))
|
||||||
{
|
{
|
||||||
remainingMixReasons.Remove(IWallet.MixingReason.NotPrivate);
|
remainingMixReasons.Remove(IWallet.MixingReason.NotPrivate);
|
||||||
}
|
}
|
||||||
@@ -266,25 +266,25 @@ public class BTCPayCoinjoinCoinSelector : IRoundCoinSelector
|
|||||||
return remainingMixReasons.Any();
|
return remainingMixReasons.Any();
|
||||||
}
|
}
|
||||||
|
|
||||||
return (solution.Coins.ToImmutableList(), (IEnumerable<AliceClient> coins) => AcceptableRegistered(coins) , AcceptableOutputs);
|
return (solution.Coins.ToImmutableList(), AcceptableRegistered , AcceptableOutputs);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<SubsetSolution> SelectCoinsInternal(UtxoSelectionParameters utxoSelectionParameters,
|
private async Task<SubsetSolution> SelectCoinsInternal(UtxoSelectionParameters utxoSelectionParameters,
|
||||||
IEnumerable<SmartCoin> coins, IEnumerable<SmartCoin> ineligibleCoins,
|
IEnumerable<SmartCoin> coins,
|
||||||
IEnumerable<PendingPayment> pendingPayments,
|
IEnumerable<PendingPayment> pendingPayments,
|
||||||
int maxCoins,
|
int maxCoins,
|
||||||
Dictionary<AnonsetType, int> maxPerType, Dictionary<AnonsetType, int> idealMinimumPerType,
|
Dictionary<AnonsetType, int> maxPerType, Dictionary<AnonsetType, int> idealMinimumPerType,
|
||||||
bool consolidationMode, Money liquidityClue, SecureRandom random, IWallet.MixingReason[] mixReason)
|
bool consolidationMode, Money liquidityClue, SecureRandom random)
|
||||||
{
|
{
|
||||||
// Sort the coins by their anon score and then by descending order their value, and then slightly randomize in 2 ways:
|
// Sort the coins by their anon score and then by descending order their value, and then slightly randomize in 2 ways:
|
||||||
//attempt to shift coins that comes from the same tx AND also attempt to shift coins based on percentage probability
|
//attempt to shift coins that comes from the same tx AND also attempt to shift coins based on percentage probability
|
||||||
var remainingCoins = SlightlyShiftOrder(RandomizeCoins(
|
var remainingCoins = SlightlyShiftOrder(RandomizeCoins(
|
||||||
coins.OrderBy(coin => coin.CoinColor(_wallet.AnonScoreTarget)).ThenByDescending(x =>
|
coins.OrderBy(coin => coin.CoinColor(_wallet)).ThenByDescending(x =>
|
||||||
x.EffectiveValue(utxoSelectionParameters.MiningFeeRate,
|
x.EffectiveValue(utxoSelectionParameters.MiningFeeRate,
|
||||||
utxoSelectionParameters.CoordinationFeeRate))
|
utxoSelectionParameters.CoordinationFeeRate))
|
||||||
.ToList(), liquidityClue), 10);
|
.ToList(), liquidityClue), 10);
|
||||||
var remainingPendingPayments = new List<PendingPayment>(pendingPayments);
|
var remainingPendingPayments = new List<PendingPayment>(pendingPayments);
|
||||||
var solution = new SubsetSolution(remainingPendingPayments.Count, _wallet.AnonScoreTarget,
|
var solution = new SubsetSolution(remainingPendingPayments.Count, _wallet,
|
||||||
utxoSelectionParameters);
|
utxoSelectionParameters);
|
||||||
|
|
||||||
|
|
||||||
@@ -308,20 +308,20 @@ public class BTCPayCoinjoinCoinSelector : IRoundCoinSelector
|
|||||||
coinColorCount.TryGetValue(coinColor.Key, out var currentCoinColorCount);
|
coinColorCount.TryGetValue(coinColor.Key, out var currentCoinColorCount);
|
||||||
if (currentCoinColorCount < coinColor.Value)
|
if (currentCoinColorCount < coinColor.Value)
|
||||||
{
|
{
|
||||||
predicate = coin1 => coin1.CoinColor(_wallet.AnonScoreTarget) == coinColor.Key;
|
predicate = coin1 => coin1.CoinColor(_wallet) == coinColor.Key;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//if the ideal amount = 0, then we should de-prioritize.
|
//if the ideal amount = 0, then we should de-prioritize.
|
||||||
predicate = coin1 => coin1.CoinColor(_wallet.AnonScoreTarget) != coinColor.Key;
|
predicate = coin1 => coin1.CoinColor(_wallet) != coinColor.Key;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var coin = remainingCoins.FirstOrDefault(predicate) ?? remainingCoins.First();
|
var coin = remainingCoins.FirstOrDefault(predicate) ?? remainingCoins.First();
|
||||||
var color = coin.CoinColor(_wallet.AnonScoreTarget);
|
var color = coin.CoinColor(_wallet);
|
||||||
// If the selected coins list is at its maximum size, break out of the loop
|
// If the selected coins list is at its maximum size, break out of the loop
|
||||||
if (solution.Coins.Count == maxCoins)
|
if (solution.Coins.Count == maxCoins)
|
||||||
{
|
{
|
||||||
@@ -330,7 +330,7 @@ public class BTCPayCoinjoinCoinSelector : IRoundCoinSelector
|
|||||||
|
|
||||||
remainingCoins.Remove(coin);
|
remainingCoins.Remove(coin);
|
||||||
if (maxPerType.TryGetValue(color, out var maxColor) &&
|
if (maxPerType.TryGetValue(color, out var maxColor) &&
|
||||||
solution.Coins.Count(coin1 => coin1.CoinColor(_wallet.AnonScoreTarget) == color) == maxColor)
|
solution.Coins.Count(coin1 => coin1.CoinColor(_wallet) == color) == maxColor)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -436,7 +436,7 @@ public class BTCPayCoinjoinCoinSelector : IRoundCoinSelector
|
|||||||
var currentCoin = remainingCoins.First();
|
var currentCoin = remainingCoins.First();
|
||||||
remainingCoins.RemoveAt(0);
|
remainingCoins.RemoveAt(0);
|
||||||
var lastCoin = workingList.LastOrDefault();
|
var lastCoin = workingList.LastOrDefault();
|
||||||
if (lastCoin is null || currentCoin.CoinColor(_wallet.AnonScoreTarget) == AnonsetType.Green ||
|
if (lastCoin is null || currentCoin.CoinColor(_wallet) == AnonsetType.Green ||
|
||||||
!remainingCoins.Any() ||
|
!remainingCoins.Any() ||
|
||||||
(remainingCoins.Count == 1 && remainingCoins.First().TransactionId == currentCoin.TransactionId) ||
|
(remainingCoins.Count == 1 && remainingCoins.First().TransactionId == currentCoin.TransactionId) ||
|
||||||
lastCoin.TransactionId != currentCoin.TransactionId ||
|
lastCoin.TransactionId != currentCoin.TransactionId ||
|
||||||
@@ -458,9 +458,9 @@ public class BTCPayCoinjoinCoinSelector : IRoundCoinSelector
|
|||||||
|
|
||||||
public static class SmartCoinExtensions
|
public static class SmartCoinExtensions
|
||||||
{
|
{
|
||||||
public static AnonsetType CoinColor(this SmartCoin coin, int anonsetTarget)
|
public static AnonsetType CoinColor(this SmartCoin coin, IWallet wallet)
|
||||||
{
|
{
|
||||||
return coin.IsPrivate(anonsetTarget)? AnonsetType.Green: coin.IsSemiPrivate(anonsetTarget)? AnonsetType.Orange: AnonsetType.Red;
|
return coin.IsPrivate(wallet)? AnonsetType.Green: coin.IsSemiPrivate(wallet)? AnonsetType.Orange: AnonsetType.Red;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -475,11 +475,11 @@ public class SubsetSolution
|
|||||||
{
|
{
|
||||||
private readonly UtxoSelectionParameters _utxoSelectionParameters;
|
private readonly UtxoSelectionParameters _utxoSelectionParameters;
|
||||||
|
|
||||||
public SubsetSolution(int totalPaymentsGross, int anonsetTarget, UtxoSelectionParameters utxoSelectionParameters)
|
public SubsetSolution(int totalPaymentsGross, IWallet wallet, UtxoSelectionParameters utxoSelectionParameters)
|
||||||
{
|
{
|
||||||
_utxoSelectionParameters = utxoSelectionParameters;
|
_utxoSelectionParameters = utxoSelectionParameters;
|
||||||
TotalPaymentsGross = totalPaymentsGross;
|
TotalPaymentsGross = totalPaymentsGross;
|
||||||
AnonsetTarget = anonsetTarget;
|
Wallet = wallet;
|
||||||
}
|
}
|
||||||
public List<SmartCoin> Coins { get; set; } = new();
|
public List<SmartCoin> Coins { get; set; } = new();
|
||||||
public List<PendingPayment> HandledPayments { get; set; } = new();
|
public List<PendingPayment> HandledPayments { get; set; } = new();
|
||||||
@@ -489,10 +489,10 @@ public class SubsetSolution
|
|||||||
.ToDecimal(MoneyUnit.BTC));
|
.ToDecimal(MoneyUnit.BTC));
|
||||||
|
|
||||||
public Dictionary<AnonsetType, SmartCoin[]> SortedCoins =>
|
public Dictionary<AnonsetType, SmartCoin[]> SortedCoins =>
|
||||||
Coins.GroupBy(coin => coin.CoinColor(AnonsetTarget)).ToDictionary(coins => coins.Key, coins => coins.ToArray());
|
Coins.GroupBy(coin => coin.CoinColor(Wallet)).ToDictionary(coins => coins.Key, coins => coins.ToArray());
|
||||||
|
|
||||||
public int TotalPaymentsGross { get; }
|
public int TotalPaymentsGross { get; }
|
||||||
public int AnonsetTarget { get; }
|
public IWallet Wallet { get; }
|
||||||
|
|
||||||
public decimal TotalPaymentCost => HandledPayments.Sum(payment =>
|
public decimal TotalPaymentCost => HandledPayments.Sum(payment =>
|
||||||
payment.ToTxOut().EffectiveCost(_utxoSelectionParameters.MiningFeeRate).ToDecimal(MoneyUnit.BTC));
|
payment.ToTxOut().EffectiveCost(_utxoSelectionParameters.MiningFeeRate).ToDecimal(MoneyUnit.BTC));
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Product>Coinjoin</Product>
|
<Product>Coinjoin</Product>
|
||||||
<Description>Allows you to integrate your btcpayserver store with coinjoins.</Description>
|
<Description>Allows you to integrate your btcpayserver store with coinjoins.</Description>
|
||||||
<Version>1.0.72</Version>
|
<Version>1.0.73</Version>
|
||||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ using WalletWasabi.Blockchain.Keys;
|
|||||||
using WalletWasabi.Blockchain.TransactionOutputs;
|
using WalletWasabi.Blockchain.TransactionOutputs;
|
||||||
using WalletWasabi.Blockchain.Transactions;
|
using WalletWasabi.Blockchain.Transactions;
|
||||||
using WalletWasabi.Extensions;
|
using WalletWasabi.Extensions;
|
||||||
|
using WalletWasabi.Helpers;
|
||||||
using WalletWasabi.Models;
|
using WalletWasabi.Models;
|
||||||
using WalletWasabi.WabiSabi;
|
using WalletWasabi.WabiSabi;
|
||||||
using WalletWasabi.WabiSabi.Backend.Rounds;
|
using WalletWasabi.WabiSabi.Backend.Rounds;
|
||||||
@@ -133,6 +134,9 @@ public class BTCPayWallet : IWallet, IDestinationProvider
|
|||||||
public const int HighAmountOfCoins = 30;
|
public const int HighAmountOfCoins = 30;
|
||||||
public int ExplicitHighestFeeTarget => WabisabiStoreSettings.PlebMode? DefaultExplicitHighestFeeTarget: WabisabiStoreSettings.ExplicitHighestFeeTarget;
|
public int ExplicitHighestFeeTarget => WabisabiStoreSettings.PlebMode? DefaultExplicitHighestFeeTarget: WabisabiStoreSettings.ExplicitHighestFeeTarget;
|
||||||
public int LowFeeTarget => WabisabiStoreSettings.PlebMode? DefaultLowFeeTarget: WabisabiStoreSettings.LowFeeTarget;
|
public int LowFeeTarget => WabisabiStoreSettings.PlebMode? DefaultLowFeeTarget: WabisabiStoreSettings.LowFeeTarget;
|
||||||
|
|
||||||
|
public bool ConsiderEntryProximity => WabisabiStoreSettings.PlebMode || WabisabiStoreSettings.ConsiderEntryProximity;
|
||||||
|
|
||||||
public bool RedCoinIsolation => !WabisabiStoreSettings.PlebMode &&WabisabiStoreSettings.RedCoinIsolation;
|
public bool RedCoinIsolation => !WabisabiStoreSettings.PlebMode &&WabisabiStoreSettings.RedCoinIsolation;
|
||||||
public bool BatchPayments => WabisabiStoreSettings.PlebMode || WabisabiStoreSettings.BatchPayments;
|
public bool BatchPayments => WabisabiStoreSettings.PlebMode || WabisabiStoreSettings.BatchPayments;
|
||||||
public long? MinimumDenominationAmount => WabisabiStoreSettings.PlebMode? 10000 : WabisabiStoreSettings.MinimumDenominationAmount;
|
public long? MinimumDenominationAmount => WabisabiStoreSettings.PlebMode? 10000 : WabisabiStoreSettings.MinimumDenominationAmount;
|
||||||
@@ -213,8 +217,8 @@ public class BTCPayWallet : IWallet, IDestinationProvider
|
|||||||
|
|
||||||
public double GetPrivacyPercentage(CoinsView coins, int privateThreshold)
|
public double GetPrivacyPercentage(CoinsView coins, int privateThreshold)
|
||||||
{
|
{
|
||||||
var privateAmount = coins.FilterBy(x => x.HdPubKey.AnonymitySet >= privateThreshold).TotalAmount();
|
var privateAmount = coins.FilterBy(x => x.IsPrivate(this)).TotalAmount();
|
||||||
var normalAmount = coins.FilterBy(x => x.HdPubKey.AnonymitySet < privateThreshold).TotalAmount();
|
var normalAmount = coins.FilterBy(x => !x.IsPrivate(this)).TotalAmount();
|
||||||
|
|
||||||
var privateDecimalAmount = privateAmount.ToDecimal(MoneyUnit.BTC);
|
var privateDecimalAmount = privateAmount.ToDecimal(MoneyUnit.BTC);
|
||||||
var normalDecimalAmount = normalAmount.ToDecimal(MoneyUnit.BTC);
|
var normalDecimalAmount = normalAmount.ToDecimal(MoneyUnit.BTC);
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
{
|
{
|
||||||
value = coin.Amount.ToDecimal(MoneyUnit.BTC),
|
value = coin.Amount.ToDecimal(MoneyUnit.BTC),
|
||||||
score = coin.AnonymitySet,
|
score = coin.AnonymitySet,
|
||||||
isPrivate = coin.CoinColor(wallet.AnonScoreTarget) == AnonsetType.Green,
|
isPrivate = coin.CoinColor(wallet) == AnonsetType.Green,
|
||||||
confirmed = coin.Confirmed,
|
confirmed = coin.Confirmed,
|
||||||
id = coin.Outpoint.ToString(),
|
id = coin.Outpoint.ToString(),
|
||||||
coinjoinInProgress = coin.CoinJoinInProgress
|
coinjoinInProgress = coin.CoinJoinInProgress
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
@inject BTCPayNetworkProvider BtcPayNetworkProvider
|
@inject BTCPayNetworkProvider BtcPayNetworkProvider
|
||||||
@inject BTCPayServerOptions BtcPayServerOptions
|
@inject BTCPayServerOptions BtcPayServerOptions
|
||||||
@{
|
@{
|
||||||
var liteMode = Context.Items.TryGetValue("cjlite" , out _);
|
var liteMode = Context.Items.TryGetValue("cjlite", out _);
|
||||||
|
|
||||||
var storeId = _scopeProvider.GetCurrentStoreId();
|
var storeId = _scopeProvider.GetCurrentStoreId();
|
||||||
ViewData.SetActivePage("CoinjoinSettings", "Coinjoin", "Coinjoin settings", storeId);
|
ViewData.SetActivePage("CoinjoinSettings", "Coinjoin", "Coinjoin settings", storeId);
|
||||||
@@ -48,19 +48,19 @@
|
|||||||
</a>
|
</a>
|
||||||
</h3>
|
</h3>
|
||||||
<div class="d-flex align-items-center gap-1 ">
|
<div class="d-flex align-items-center gap-1 ">
|
||||||
<div class="d-flex align-items-center @(liteMode? "d-none": "")">
|
<div class="d-flex align-items-center @(liteMode ? "d-none" : "")">
|
||||||
<input asp-for="Active" type="checkbox" class="btcpay-toggle me-2"/>
|
<input asp-for="Active" type="checkbox" class="btcpay-toggle me-2"/>
|
||||||
<label asp-for="Active" class="form-label mb-0 me-1"></label>
|
<label asp-for="Active" class="form-label mb-0 me-1"></label>
|
||||||
</div>
|
</div>
|
||||||
<button name="command" type="submit" value="save" class="btn btn-primary mt-3 mt-sm-0 @(liteMode? "btn-lin": "btn-secondary")">Save</button>
|
<button name="command" type="submit" value="save" class="btn btn-primary mt-3 mt-sm-0 @(liteMode ? "btn-lin" : "btn-secondary")">Save</button>
|
||||||
<a asp-action="ListCoinjoins" asp-route-storeId="@storeId" class="btn btn-secondary mt-3 mt-sm-0 @(liteMode? "d-none": "")" role="button">
|
<a asp-action="ListCoinjoins" asp-route-storeId="@storeId" class="btn btn-secondary mt-3 mt-sm-0 @(liteMode ? "d-none" : "")" role="button">
|
||||||
Coinjoin History
|
Coinjoin History
|
||||||
</a>
|
</a>
|
||||||
<button type="button" class="btn btn-secondary mt-3 mt-sm-0 @(liteMode? "d-none": "")" permission="@Policies.CanModifyServerSettings"
|
<button type="button" class="btn btn-secondary mt-3 mt-sm-0 @(liteMode ? "d-none" : "")" permission="@Policies.CanModifyServerSettings"
|
||||||
data-bs-toggle="modal" data-bs-target="#discover-prompt">
|
data-bs-toggle="modal" data-bs-target="#discover-prompt">
|
||||||
Add Coordinator
|
Add Coordinator
|
||||||
</button>
|
</button>
|
||||||
<a asp-controller="WabisabiCoordinatorConfig" asp-action="UpdateWabisabiSettings" class="btn @(liteMode? "btn-lin": "btn-secondary") mt-3 mt-sm-0" permission="@Policies.CanModifyServerSettings">Coordinator</a>
|
<a asp-controller="WabisabiCoordinatorConfig" asp-action="UpdateWabisabiSettings" class="btn @(liteMode ? "btn-lin" : "btn-secondary") mt-3 mt-sm-0" permission="@Policies.CanModifyServerSettings">Coordinator</a>
|
||||||
|
|
||||||
@* <a class="btn btn-secondary mt-3 mt-sm-0" href="https://gist.github.com/nopara73/bb17e89d7dc9af536ca41f50f705d329" rel="noreferrer noopener" target="_blank">Enable Discreet payments - Coming soon</a> *@
|
@* <a class="btn btn-secondary mt-3 mt-sm-0" href="https://gist.github.com/nopara73/bb17e89d7dc9af536ca41f50f705d329" rel="noreferrer noopener" target="_blank">Enable Discreet payments - Coming soon</a> *@
|
||||||
</div>
|
</div>
|
||||||
@@ -82,7 +82,6 @@
|
|||||||
<span class="ms-3">This wallet is either not a hot wallet, or enabled in your store settings and will not be able to participate in coinjoins.</span>
|
<span class="ms-3">This wallet is either not a hot wallet, or enabled in your store settings and will not be able to participate in coinjoins.</span>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
<style>
|
<style>
|
||||||
#blocker:hover{
|
#blocker:hover{
|
||||||
@@ -127,6 +126,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="advanced" class="@(Model.PlebMode ? "d-none" : "")">
|
<div id="advanced" class="@(Model.PlebMode ? "d-none" : "")">
|
||||||
<button type="submit" name="command" value="reset" class="btn btn-link">Reset to defaults </button>
|
<button type="submit" name="command" value="reset" class="btn btn-link">Reset to defaults </button>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-sm-12 col-md-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
||||||
<label asp-for="AnonymitySetTarget" class="form-label">Anon score target</label>
|
<label asp-for="AnonymitySetTarget" class="form-label">Anon score target</label>
|
||||||
@@ -134,6 +137,17 @@
|
|||||||
|
|
||||||
<p class="text-muted">Scores your coinjoined utxos based on how many other utxos in the coinjoin (and other previous coinjoin rounds) had the same value.<br/> Anonset score computation is not an exact science, and when using coordinators with massive liquidity, is not that important as all rounds (past, present, future) contribute to your privacy.</p>
|
<p class="text-muted">Scores your coinjoined utxos based on how many other utxos in the coinjoin (and other previous coinjoin rounds) had the same value.<br/> Anonset score computation is not an exact science, and when using coordinators with massive liquidity, is not that important as all rounds (past, present, future) contribute to your privacy.</p>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-12 col-md-6">
|
||||||
|
<div class="form-group form-check">
|
||||||
|
<label asp-for="ConsiderEntryProximity" class="form-check-label">Consider entry proximity</label>
|
||||||
|
<input asp-for="ConsiderEntryProximity" type="checkbox" class="form-check-input"/>
|
||||||
|
<p class="text-muted">Coins which have been mixed but are only one hop away from the original coinjoin transaction won't be considered private. This helps break linking assumptions when coins are spent.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-sm-12 col-md-6">
|
<div class="col-sm-12 col-md-6">
|
||||||
@@ -456,7 +470,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section PageFootContent {
|
@section PageFootContent {
|
||||||
<partial name="_ValidationScriptsPartial"/>
|
<partial name="_ValidationScriptsPartial"/>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ public class WabisabiStoreSettings
|
|||||||
public int ExplicitHighestFeeTarget { get; set; } = BTCPayWallet.DefaultExplicitHighestFeeTarget;
|
public int ExplicitHighestFeeTarget { get; set; } = BTCPayWallet.DefaultExplicitHighestFeeTarget;
|
||||||
public int LowFeeTarget { get; set; } = BTCPayWallet.DefaultLowFeeTarget;
|
public int LowFeeTarget { get; set; } = BTCPayWallet.DefaultLowFeeTarget;
|
||||||
|
|
||||||
|
public bool ConsiderEntryProximity { get; set; } = true;
|
||||||
|
|
||||||
public enum CrossMixMode
|
public enum CrossMixMode
|
||||||
{
|
{
|
||||||
WhenFree,
|
WhenFree,
|
||||||
|
|||||||
Submodule submodules/btcpayserver updated: cb54f8f6d1...2111b67e2c
Submodule submodules/walletwasabi updated: 32d6c82f6e...9e2ba36ffd
Reference in New Issue
Block a user