wallet: use correct denoms as refresh targets

This commit is contained in:
Florian Dold 2021-12-01 18:07:55 +01:00
parent 2dc876d6d6
commit 9f60e3d7ec
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
2 changed files with 8 additions and 5 deletions

View File

@ -162,8 +162,10 @@ export async function getTotalPaymentCost(
);
}
const allDenoms = await tx.denominations.indexes.byExchangeBaseUrl
.iter()
.toArray();
.iter(coin.exchangeBaseUrl)
.filter((x) =>
Amounts.isSameCurrency(x.value, pcs.coinContributions[i]),
);
const amountLeft = Amounts.sub(denom.value, pcs.coinContributions[i])
.amount;
const refreshCost = getTotalRefreshCost(allDenoms, denom, amountLeft);

View File

@ -773,7 +773,8 @@ export async function updateWithdrawalDenoms(
denom.verificationStatus === DenominationVerificationStatus.Unverified
) {
logger.trace(
`Validating denomination (${current + 1}/${denominations.length
`Validating denomination (${current + 1}/${
denominations.length
}) signature of ${denom.denomPubHash}`,
);
const valid = await ws.cryptoApi.isValidDenom(