Make sure to only select accounted payments where we should (#2523)

This commit is contained in:
Nicolas Dorier
2021-05-14 16:16:19 +09:00
committed by GitHub
parent 776ded0b7e
commit c551e5cd0a
16 changed files with 48 additions and 42 deletions

View File

@@ -133,9 +133,9 @@ namespace BTCPayServer
finally { try { webSocket.Dispose(); } catch { } }
}
public static IEnumerable<BitcoinLikePaymentData> GetAllBitcoinPaymentData(this InvoiceEntity invoice)
public static IEnumerable<BitcoinLikePaymentData> GetAllBitcoinPaymentData(this InvoiceEntity invoice, bool accountedOnly)
{
return invoice.GetPayments()
return invoice.GetPayments(accountedOnly)
.Where(p => p.GetPaymentMethodId()?.PaymentType == PaymentTypes.BTCLike)
.Select(p => (BitcoinLikePaymentData)p.GetCryptoPaymentData())
.Where(data => data != null);