taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 0f607edbb2146ff82f9dcd71a1fe2905630c0d58
parent ade05920dc3c877c89149fcfa9fb4246b50216ea
Author: Florian Dold <florian.dold@gmail.com>
Date:   Wed, 17 Feb 2016 18:59:27 +0100

debug

Diffstat:
Mextension/lib/wallet/wallet.ts | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/extension/lib/wallet/wallet.ts b/extension/lib/wallet/wallet.ts @@ -442,6 +442,8 @@ export class Wallet { private getPossibleMintCoins(paymentAmount: AmountJson, depositFeeLimit: AmountJson, allowedMints: MintInfo[]): Promise<MintCoins> { + // Mapping from mint base URL to list of coins together with their + // denomination let m: MintCoins = {}; function storeMintCoin(mc) { @@ -472,6 +474,16 @@ export class Wallet { return Promise.all(ps).then(() => { let ret: MintCoins = {}; + if (Object.keys(m).length == 0) { + console.log("not suitable mints found"); + } + + console.dir(m); + + // We try to find the first mint where we have + // enough coins to cover the paymentAmount with fees + // under depositFeeLimit + nextMint: for (let key in m) { let coins = m[key].map((x) => ({ @@ -495,6 +507,8 @@ export class Wallet { accFee.add(coinFee); accAmount.add(coinAmount); if (accFee.cmp(maxFee) >= 0) { + // FIXME: if the fees are too high, we have + // to cover them ourselves .... console.log("too much fees"); continue nextMint; }