diff --git a/BTCPayServer/PayoutProcessors/Lightning/LightningAutomatedPayoutProcessor.cs b/BTCPayServer/PayoutProcessors/Lightning/LightningAutomatedPayoutProcessor.cs index 253f28a11..81144667f 100644 --- a/BTCPayServer/PayoutProcessors/Lightning/LightningAutomatedPayoutProcessor.cs +++ b/BTCPayServer/PayoutProcessors/Lightning/LightningAutomatedPayoutProcessor.cs @@ -225,6 +225,10 @@ public class LightningAutomatedPayoutProcessor : BaseAutomatedPayoutProcessor
  • s.Value.CurrencyValue).Sum(); foreach (var kv in allStats .GroupBy(k => k.Key, k => k.Value) - .Select(g => (g.Key, CurrencyValue: g.Sum(s => s.CurrencyValue)))) + .Select(g => (g.Key, + PaymentCurrency: g.Select(s => s.Currency).First(), + CurrencyValue: g.Sum(s => s.CurrencyValue)))) { var pmi = PaymentMethodId.Parse(kv.Key); r.TryAdd(kv.Key, new PaymentStat() @@ -259,7 +261,7 @@ namespace BTCPayServer.Plugins.Crowdfund Label = _prettyNameProvider.PrettyName(pmi), Percent = (kv.CurrencyValue / total) * 100.0m, // Note that the LNURL will have the same LN - IsLightning = pmi == PaymentTypes.LN.GetPaymentMethodId(kv.Key) + IsLightning = pmi == PaymentTypes.LN.GetPaymentMethodId(kv.PaymentCurrency) }); } return r; diff --git a/BTCPayServer/Services/Invoices/InvoiceRepository.cs b/BTCPayServer/Services/Invoices/InvoiceRepository.cs index e43c63e34..ae8c15b3e 100644 --- a/BTCPayServer/Services/Invoices/InvoiceRepository.cs +++ b/BTCPayServer/Services/Invoices/InvoiceRepository.cs @@ -873,7 +873,7 @@ retry: .GroupBy(p => p.GroupKey) .ToDictionary(p => p.Key, p => new InvoiceStatistics.Contribution { - Currency = p.Key, + Currency = p.Select(p => p.Currency).First(), Settled = p.All(v => v.Settled), Divisibility = p.Max(p => p.Divisibility), Value = p.Select(v => v.Value).Sum(),