fix: do not count coins with other currency
This commit is contained in:
parent
928fe2d019
commit
e263fe3508
@ -379,6 +379,9 @@ export async function getMerchantPaymentBalanceDetails(
|
|||||||
])
|
])
|
||||||
.runReadOnly(async (tx) => {
|
.runReadOnly(async (tx) => {
|
||||||
await tx.coinAvailability.iter().forEach((ca) => {
|
await tx.coinAvailability.iter().forEach((ca) => {
|
||||||
|
if (ca.currency != req.currency) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const singleCoinAmount: AmountJson = {
|
const singleCoinAmount: AmountJson = {
|
||||||
currency: ca.currency,
|
currency: ca.currency,
|
||||||
fraction: ca.amountFrac,
|
fraction: ca.amountFrac,
|
||||||
@ -413,6 +416,9 @@ export async function getMerchantPaymentBalanceDetails(
|
|||||||
});
|
});
|
||||||
|
|
||||||
await tx.refreshGroups.iter().forEach((r) => {
|
await tx.refreshGroups.iter().forEach((r) => {
|
||||||
|
if (r.currency != req.currency) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
d.balanceAvailable = Amounts.add(
|
d.balanceAvailable = Amounts.add(
|
||||||
d.balanceAvailable,
|
d.balanceAvailable,
|
||||||
computeRefreshGroupAvailableAmount(r),
|
computeRefreshGroupAvailableAmount(r),
|
||||||
|
Loading…
Reference in New Issue
Block a user