mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2025-12-19 08:34:26 +01:00
fix
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Product>LN Prism</Product>
|
<Product>LN Prism</Product>
|
||||||
<Description>Automated value splits for lightning.</Description>
|
<Description>Automated value splits for lightning.</Description>
|
||||||
<Version>1.1.3</Version>
|
<Version>1.1.4</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<!-- Plugin development properties -->
|
<!-- Plugin development properties -->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ else
|
|||||||
|
|
||||||
private void SatBreakerOnPrismUpdated(object sender, PrismPaymentDetectedEventArgs e)
|
private void SatBreakerOnPrismUpdated(object sender, PrismPaymentDetectedEventArgs e)
|
||||||
{
|
{
|
||||||
|
if(e.StoreId != StoreId) return;
|
||||||
if (e.Settings != Settings && e.Settings.Version != Settings.Version)
|
if (e.Settings != Settings && e.Settings.Version != Settings.Version)
|
||||||
{
|
{
|
||||||
Settings.DestinationBalance = e.Settings.DestinationBalance;
|
Settings.DestinationBalance = e.Settings.DestinationBalance;
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ namespace BTCPayServer.Plugins.Prism
|
|||||||
{
|
{
|
||||||
prismSettings.DestinationBalance[destination] = currentBalance + splitMSats;
|
prismSettings.DestinationBalance[destination] = currentBalance + splitMSats;
|
||||||
}
|
}
|
||||||
else
|
else if(splitMSats > 0)
|
||||||
{
|
{
|
||||||
prismSettings.DestinationBalance.Add(destination, splitMSats);
|
prismSettings.DestinationBalance.Add(destination, splitMSats);
|
||||||
}
|
}
|
||||||
@@ -438,8 +438,13 @@ namespace BTCPayServer.Plugins.Prism
|
|||||||
prismSettings.PendingPayouts ??= new();
|
prismSettings.PendingPayouts ??= new();
|
||||||
prismSettings.PendingPayouts.Add(payout.PayoutData.Id,
|
prismSettings.PendingPayouts.Add(payout.PayoutData.Id,
|
||||||
new PendingPayout(payoutAmount, reserveFee));
|
new PendingPayout(payoutAmount, reserveFee));
|
||||||
prismSettings.DestinationBalance.AddOrReplace(destination,
|
var newAmount = amtMsats - (payoutAmount + reserveFee) * 1000;
|
||||||
amtMsats - (payoutAmount + reserveFee) * 1000);
|
if(newAmount == 0)
|
||||||
|
prismSettings.DestinationBalance.Remove(destination);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
prismSettings.DestinationBalance.AddOrReplace(destination,newAmount);
|
||||||
|
}
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user