mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2025-12-17 07:34:24 +01:00
update nostr
This commit is contained in:
@@ -195,12 +195,16 @@ public class BTCPayCoinjoinCoinSelector : IRoundCoinSelector
|
||||
continue;
|
||||
}
|
||||
|
||||
//if we have less than the max suggested output registration, we should add more coins to reach that number to avoid breaking up into too many coins?
|
||||
var isLessThanMaxOutputRegistration = solution.Coins.Count < 8;
|
||||
|
||||
var rand = Random.Shared.Next(1, 101);
|
||||
//let's check how many coins we are allowed to add max and how many we added, and use that percentage as the random chance of not adding it.
|
||||
// if max coins = 20, and current coins = 5 then 5/20 = 0.25 * 100 = 25
|
||||
var maxCoinCapacityPercentage = Math.Floor((solution.Coins.Count / (decimal)maxCoins) * 100);
|
||||
//aggressively attempt to reach max coin target if consolidation mode is on
|
||||
var chance = consolidationMode ? 90 : 100 - maxCoinCapacityPercentage;
|
||||
//if we're less than the max output registration, we should be more aggressive in adding coins
|
||||
var chance = consolidationMode ? 90 : 100m - Math.Min(maxCoinCapacityPercentage, isLessThanMaxOutputRegistration ? 50m : maxCoinCapacityPercentage);
|
||||
_logger.LogDebug(
|
||||
$"coin selection: no payms left but at {solution.Coins.Count()} coins. random chance to add another coin if: {chance} <= {rand} (random 0-100) ");
|
||||
if (chance <= rand)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<PropertyGroup>
|
||||
<Product>Wabisabi Coinjoin</Product>
|
||||
<Description>Allows you to integrate your btcpayserver store with coinjoins.</Description>
|
||||
<Version>1.0.34</Version>
|
||||
<Version>1.0.35</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Plugin development properties -->
|
||||
@@ -43,7 +43,7 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NNostr.Client" Version="0.0.24" />
|
||||
<PackageReference Include="NNostr.Client" Version="0.0.25" />
|
||||
<PackageReference Include="WabiSabi" Version="1.0.1.2" />
|
||||
</ItemGroup>
|
||||
<Target Name="DeleteExampleFile" AfterTargets="Publish">
|
||||
|
||||
Reference in New Issue
Block a user