From 0f607edbb2146ff82f9dcd71a1fe2905630c0d58 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 17 Feb 2016 18:59:27 +0100 Subject: debug --- extension/lib/wallet/wallet.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/extension/lib/wallet/wallet.ts b/extension/lib/wallet/wallet.ts index fe3148c9b..608876abf 100644 --- 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 { + // 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; } -- cgit v1.2.3